summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2015-10-06 15:02:24 +0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2015-10-06 15:02:24 +0200
commitbacb839e39aeaa603957322429eac3d44032193f (patch)
tree3518f99f9994331fed9f811caa48153a3bea672a
parentfe26e8dd85c8500ea494c82beb66a55ebcad64f4 (diff)
settingspane: cleanup codedevs/bu5hm4n/settingswidget
-rw-r--r--src/lib/elc_settingspane.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/lib/elc_settingspane.c b/src/lib/elc_settingspane.c
index 0164db022..db5e2d585 100644
--- a/src/lib/elc_settingspane.c
+++ b/src/lib/elc_settingspane.c
@@ -33,10 +33,7 @@ typedef struct
33 33
34typedef struct 34typedef struct
35{ 35{
36 Evas_Object *apply; //< apply button
37 Evas_Object *reset; //< reset button
38 Evas_Object *layout; //< The layout where everything is displayed 36 Evas_Object *layout; //< The layout where everything is displayed
39 Eina_Bool hidden; //< true if it is realized but hidden
40} Panel; 37} Panel;
41 38
42typedef struct 39typedef struct
@@ -826,7 +823,7 @@ _elm_settingspane_item_image_get(Eo *obj EINA_UNUSED, Elm_Settingspane_Item_Data
826} 823}
827 824
828EOLIAN static Elm_Settingspane_Item * 825EOLIAN static Elm_Settingspane_Item *
829_elm_settingspane_item_append(Eo *obj, Elm_Settingspane_Data *pd, void *data, const char *name, Elm_Settingspane_Item *par) 826_elm_settingspane_item_append(Eo *obj EINA_UNUSED, Elm_Settingspane_Data *pd, void *data, const char *name, Elm_Settingspane_Item *par)
830{ 827{
831 return _elm_settingspane_item_append_full(pd, data, eina_stringshare_add(name), par, NULL); 828 return _elm_settingspane_item_append_full(pd, data, eina_stringshare_add(name), par, NULL);
832} 829}
@@ -851,26 +848,24 @@ _elm_settingspane_item_focus(Eo *obj, Elm_Settingspane_Item_Data *pd)
851static void 848static void
852_default_reached_cb(void *data, Evas_Object *obj, const char *emission EINA_UNUSED, const char *source EINA_UNUSED) 849_default_reached_cb(void *data, Evas_Object *obj, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
853{ 850{
854 Panel *p; 851 Panel *p = data;
852
855 if (!data) 853 if (!data)
856 { 854 {
855 //this was a search run
857 evas_object_del(obj); 856 evas_object_del(obj);
858 return; 857 return;
859 } 858 }
860 859 else
861 IC_DATA(data); 860 {
862 if (!id) return; 861 //a realized panel
863 862 evas_object_del(p->layout);
864 p = id->panel; 863 free(p);
865 864 }
866 evas_object_del(p->layout);
867 free(p);
868 id->panel = NULL;
869 DBG("delete item %p", data);
870} 865}
871 866
872static Panel* 867static Panel*
873_item_panel_realize(Eo *obj, Evas_Object *w, Evas_Object *content) 868_item_panel_realize(Eo *obj EINA_UNUSED, Evas_Object *w, Evas_Object *content)
874{ 869{
875 Panel *p; 870 Panel *p;
876 Evas_Object *bx, *sc; 871 Evas_Object *bx, *sc;
@@ -881,7 +876,7 @@ _item_panel_realize(Eo *obj, Evas_Object *w, Evas_Object *content)
881 evas_object_size_hint_weight_set(p->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 876 evas_object_size_hint_weight_set(p->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
882 evas_object_size_hint_align_set(p->layout, EVAS_HINT_FILL, EVAS_HINT_FILL); 877 evas_object_size_hint_align_set(p->layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
883 elm_layout_theme_set(p->layout, "settingspane", "panel", "default"); 878 elm_layout_theme_set(p->layout, "settingspane", "panel", "default");
884 elm_layout_signal_callback_add(p->layout, "elm,state,default,reached", EMITTER, _default_reached_cb, obj); 879 elm_layout_signal_callback_add(p->layout, "elm,state,default,reached", EMITTER, _default_reached_cb, p);
885 880
886 bx = elm_box_add(w); 881 bx = elm_box_add(w);
887 evas_object_size_hint_weight_set(bx, 0, 0); 882 evas_object_size_hint_weight_set(bx, 0, 0);
@@ -1037,8 +1032,8 @@ _elm_settingspane_item_realize(Eo *obj, Elm_Settingspane_Item_Data *pd)
1037static void 1032static void
1038_item_panel_unrealize(Eo *obj EINA_UNUSED, Elm_Settingspane_Item_Data *pd) 1033_item_panel_unrealize(Eo *obj EINA_UNUSED, Elm_Settingspane_Item_Data *pd)
1039{ 1034{
1040 Panel *p = pd->panel; 1035 elm_layout_signal_emit(pd->panel->layout, EMIT_CONTENT_DEFAULT);
1041 elm_layout_signal_emit(p->layout, EMIT_CONTENT_DEFAULT); 1036 pd->panel = NULL;
1042} 1037}
1043 1038
1044static void 1039static void