elementary/layout - added theme changed hook
authorChunEon Park <chuneon.park@samsung.com>
Thu, 21 Jul 2011 03:25:42 +0000 (12:25 +0900)
committerChunEon Park <chuneon.park@samsung.com>
Thu, 21 Jul 2011 03:25:42 +0000 (12:25 +0900)
Because the user can use their' own edj objs and call the signals for the edj objs,
They have a responsibility to reset the status of the edj objs when layout theme is changed.

This "theme,changed" signal provides to user a chance to reset (signal-emit) again.

Author: hermet
Date: 2011-07-20 01:36:40 -0700 (Wed, 20 Jul 2011)
New Revision: 61518
Trac: http://trac.enlightenment.org/e/changeset/61518

src/lib/elm_layout.c

index 394a90f..ed411e6 100644 (file)
@@ -70,6 +70,13 @@ static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *eve
 static void _sub_del(void *data, Evas_Object *obj, void *event_info);
 static void _part_cursor_free(Part_Cursor *pc);
 
+static const char SIG_THEME_CHANGED[] = "theme,changed";
+
+static const Evas_Smart_Cb_Description _signals[] = {
+   {SIG_THEME_CHANGED, ""},
+   {NULL, NULL}
+};
+
 static void
 _del_hook(Evas_Object *obj)
 {
@@ -107,6 +114,7 @@ _theme_hook(Evas_Object *obj)
    _elm_theme_object_set(obj, wd->lay, wd->clas, wd->group, wd->style);
    edje_object_scale_set(wd->lay, elm_widget_scale_get(obj) *
                          _elm_config->scale);
+   evas_object_smart_callback_call(obj, SIG_THEME_CHANGED, NULL);
    _sizing_eval(wd);
 }
 
@@ -399,6 +407,7 @@ elm_layout_add(Evas_Object *parent)
                                    _signal_size_eval, wd);
 
    evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+   evas_object_smart_callbacks_descriptions_set(obj, _signals);
 
    _mirrored_set(obj, elm_widget_mirrored_get(obj));
    _request_sizing_eval(wd);