From c6899f52c9c9aa5ee299422b0e931a6dcd9f4b47 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Iv=C3=A1n=20Briano?= Date: Wed, 12 May 2010 21:59:08 +0000 Subject: [PATCH] Signal edje when clock gets focused. By Rafael Fonseca SVN revision: 48789 --- src/lib/elm_clock.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/lib/elm_clock.c b/src/lib/elm_clock.c index b7131d3..092f1a7 100644 --- a/src/lib/elm_clock.c +++ b/src/lib/elm_clock.c @@ -61,10 +61,25 @@ _theme_hook(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"); 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_clock_add(Evas_Object *parent) 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); -- 2.7.4