From: Enlightenment S. <no-...@en...> - 2011-07-12 08:22:23
|
Log: elementary/elm_widget : add focus_disabled_handle. Author: woohyun Date: 2011-07-12 01:22:16 -0700 (Tue, 12 Jul 2011) New Revision: 61270 Trac: http://trac.enlightenment.org/e/changeset/61270 Modified: trunk/elementary/src/lib/elm_widget.c trunk/elementary/src/lib/elm_widget.h Modified: trunk/elementary/src/lib/elm_widget.c =================================================================== --- trunk/elementary/src/lib/elm_widget.c 2011-07-12 06:11:23 UTC (rev 61269) +++ trunk/elementary/src/lib/elm_widget.c 2011-07-12 08:22:16 UTC (rev 61270) @@ -1806,25 +1806,7 @@ if (sd->disabled == disabled) return; sd->disabled = !!disabled; - if (sd->focused) - { - Evas_Object *o, *parent; - parent = obj; - o = elm_widget_parent_get(parent); - if (!o) - elm_widget_focused_object_clear(parent); - else - { - parent = o; - for (;;) - { - o = elm_widget_parent_get(parent); - if (!o) break; - parent = o; - } - elm_widget_focus_cycle(parent, ELM_FOCUS_NEXT); - } - } + elm_widget_focus_disabled_handle(obj); if (sd->disable_func) sd->disable_func(obj); } @@ -2290,6 +2272,17 @@ elm_widget_focus_steal(o); } +EAPI void +elm_widget_focus_disabled_handle(Evas_Object *obj) +{ + API_ENTRY return; + + if (!elm_widget_parent_get(obj)) + elm_widget_focused_object_clear(obj); + else + _if_focused_revert(obj, EINA_TRUE); +} + /** * @internal * Modified: trunk/elementary/src/lib/elm_widget.h =================================================================== --- trunk/elementary/src/lib/elm_widget.h 2011-07-12 06:11:23 UTC (rev 61269) +++ trunk/elementary/src/lib/elm_widget.h 2011-07-12 08:22:16 UTC (rev 61270) @@ -310,6 +310,7 @@ EAPI void elm_widget_stringlist_free(Eina_List *list); EAPI void elm_widget_focus_hide_handle(Evas_Object *obj); EAPI void elm_widget_focus_mouse_down_handle(Evas_Object *obj); +EAPI void elm_widget_focus_disabled_handle(Evas_Object *obj); EAPI void elm_widget_text_part_set(Evas_Object *obj, const char *item, const char *label); EAPI const char *elm_widget_text_part_get(const Evas_Object *obj, const char *item); |