Signal edje when clock gets focused.

By Rafael Fonseca


SVN revision: 48789
This commit is contained in:
Iván Briano 2010-05-12 21:59:08 +00:00
parent 5d79733553
commit 0e397de63c
1 changed files with 16 additions and 0 deletions

View File

@ -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);