summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2015-02-03 12:23:59 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2015-10-05 12:54:39 +0200
commit3d44dea840adb8e6a1fa367390f67761296f077c (patch)
tree8b437490f5388e149bfb88e0bf41314e0ea95bc1
parent09c5d0cc396b84b88c38d44acf247c7308792553 (diff)
settingswidget: Added new api call recreate
-rw-r--r--src/bin/test_settingspane.c17
-rw-r--r--src/lib/elc_settingspane.c25
-rw-r--r--src/lib/elm_settingspane_item.eo5
3 files changed, 47 insertions, 0 deletions
diff --git a/src/bin/test_settingspane.c b/src/bin/test_settingspane.c
index 93d9f6df7..4efac888a 100644
--- a/src/bin/test_settingspane.c
+++ b/src/bin/test_settingspane.c
@@ -204,6 +204,15 @@ del_focused_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_U
204 elm_settingspane_item_delete(item); 204 elm_settingspane_item_delete(item);
205} 205}
206 206
207static void
208recreate_focused_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
209{
210 Elm_Settingspane_Item *item;
211
212 item = elm_settingspane_focused_get(data);
213
214 elm_settingspane_item_recreate(item);
215}
207 216
208void 217void
209test_settingspane(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 218test_settingspane(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
@@ -299,6 +308,14 @@ test_settingspane(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
299 elm_box_pack_end(btnbox, o); 308 elm_box_pack_end(btnbox, o);
300 evas_object_show(o); 309 evas_object_show(o);
301 310
311 o = elm_button_add(win);
312 elm_object_text_set(o, "recreate current item");
313 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
314 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
315 evas_object_smart_callback_add(o, "clicked", recreate_focused_cb, sw);
316 elm_box_pack_end(btnbox, o);
317 evas_object_show(o);
318
302 evas_object_show(win); 319 evas_object_show(win);
303 evas_object_resize(win, 500, 500); 320 evas_object_resize(win, 500, 500);
304} 321}
diff --git a/src/lib/elc_settingspane.c b/src/lib/elc_settingspane.c
index 6ee5e727f..e45fccdfc 100644
--- a/src/lib/elc_settingspane.c
+++ b/src/lib/elc_settingspane.c
@@ -1514,6 +1514,31 @@ _elm_settingspane_item_eo_base_destructor(Eo *obj EINA_UNUSED, Elm_Settingspane_
1514 eo_do_super(obj, ELM_SETTINGSPANE_ITEM_CLASS, eo_destructor()); 1514 eo_do_super(obj, ELM_SETTINGSPANE_ITEM_CLASS, eo_destructor());
1515} 1515}
1516 1516
1517EOLIAN static void
1518_elm_settingspane_item_recreate(Elm_Settingspane_Item *obj, Elm_Settingspane_Item_Data *pd)
1519{
1520 Evas_Object *shown = evas_object_data_get(pd->sw, DK_MAIN_PANEL_SHOWED);
1521 Evas_Object *tmp;
1522 Elm_Settingspane_Item *cf;
1523
1524 cf = eo_do(pd->sw, elm_obj_settingspane_focused_get());
1525
1526 if (cf != obj) return;
1527
1528 tmp = elm_scroller_add(pd->sw);
1529 eo_ref(tmp);
1530 evas_object_size_hint_weight_set(tmp, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1531 evas_object_show(tmp);
1532 elm_object_content_set(tmp, _item_content_get(obj, pd->sw));
1533
1534 elm_layout_content_unset(shown, POS_PANEL_CONTENT);
1535 elm_object_part_content_set(shown, POS_PANEL_CONTENT, tmp);
1536
1537 if (pd->panel.tmp_content)
1538 _content_del(obj);
1539
1540 pd->panel.tmp_content = tmp;
1541}
1517 1542
1518EOLIAN static void 1543EOLIAN static void
1519_elm_settingspane_item_keywords_set(Elm_Settingspane_Item *obj EINA_UNUSED, Elm_Settingspane_Item_Data *pd, Eina_Stringshare *str) 1544_elm_settingspane_item_keywords_set(Elm_Settingspane_Item *obj EINA_UNUSED, Elm_Settingspane_Item_Data *pd, Eina_Stringshare *str)
diff --git a/src/lib/elm_settingspane_item.eo b/src/lib/elm_settingspane_item.eo
index 9ad8bc894..99adadb0a 100644
--- a/src/lib/elm_settingspane_item.eo
+++ b/src/lib/elm_settingspane_item.eo
@@ -113,6 +113,11 @@ class Elm_Settingspane_Item(Eo.Base){
113 } 113 }
114 } 114 }
115 methods { 115 methods {
116 recreate {
117 /*@
118 Recreates the content of a item when the item is currently displayed
119 */
120 }
116 attach_panel { 121 attach_panel {
117 /*@ 122 /*@
118 Attach a panel to the item 123 Attach a panel to the item