From: Enlightenment S. <no-...@en...> - 2010-05-12 21:59:16
|
Log: Signal edje when clock gets focused. By Rafael Fonseca Author: sachiel Date: 2010-05-12 14:59:08 -0700 (Wed, 12 May 2010) New Revision: 48789 Modified: trunk/TMP/st/elementary/src/lib/elm_clock.c Modified: trunk/TMP/st/elementary/src/lib/elm_clock.c =================================================================== --- trunk/TMP/st/elementary/src/lib/elm_clock.c 2010-05-12 20:55:36 UTC (rev 48788) +++ trunk/TMP/st/elementary/src/lib/elm_clock.c 2010-05-12 21:59:08 UTC (rev 48789) @@ -61,10 +61,25 @@ { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; + if (elm_widget_focus_get(obj)) + edje_object_signal_emit(wd->clk, "elm,action,focus", "elm"); + else + edje_object_signal_emit(wd->clk, "elm,action,unfocus", "elm"); wd->cur.am_pm = !wd->cur.am_pm; /* hack - force update */ _time_update(obj); } +static void +_on_focus_hook(void *data __UNUSED__, Evas_Object *obj) +{ + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + if (elm_widget_focus_get(obj)) + edje_object_signal_emit(wd->clk, "elm,action,focus", "elm"); + else + edje_object_signal_emit(wd->clk, "elm,action,unfocus", "elm"); +} + static int _ticker(void *data) { @@ -399,6 +414,7 @@ elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); + elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); wd->clk = edje_object_add(e); elm_widget_resize_object_set(obj, wd->clk); |