summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2014-12-01 19:51:58 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2014-12-01 19:51:58 +0100
commit6bbb86a4b5b9f26da97e80e7dc8cc2d0bde1f685 (patch)
tree49e1d5e307443d8ce50ddfcf3d64e091d5728cf5
parentd6bc5881b8edb49f9354eece1b1feff34562bf78 (diff)
Abstracted layout positions.
-rw-r--r--src/elm_settingspane.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/elm_settingspane.c b/src/elm_settingspane.c
index 401cfea..decbeb0 100644
--- a/src/elm_settingspane.c
+++ b/src/elm_settingspane.c
@@ -51,6 +51,20 @@ static void _item_stack_pop(Elm_Settingspane *pane);
51#define DK_MENU_GENLIST "__menu_genlist" 51#define DK_MENU_GENLIST "__menu_genlist"
52#define DK_MENU_ITEM_SHOWN "__showed_item" 52#define DK_MENU_ITEM_SHOWN "__showed_item"
53 53
54/* Layout positions */
55
56#define POS_PANEL_PAD "conf.pad"
57#define POS_PANEL_CONTROLS "conf.controls"
58#define POS_PANEL_CONTENT "conf.content"
59
60#define POS_MENU_CONTENT "conf.content"
61
62#define POS_MAIN_TITLE "conf.title"
63#define POS_MAIN_PANEL "conf.panel"
64#define POS_MAIN_MENU "conf.menu"
65#define POS_MAIN_SEARCH "conf.search"
66
67
54static void 68static void
55conf_menu_back_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *emission EINA_UNUSED, const char *source EINA_UNUSED) 69conf_menu_back_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
56{ 70{
@@ -191,7 +205,7 @@ _content_layout_content_init(Evas_Object *w)
191 pad = evas_object_rectangle_add(evas_object_evas_get(w)); 205 pad = evas_object_rectangle_add(evas_object_evas_get(w));
192 evas_object_size_hint_weight_set(pad, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 206 evas_object_size_hint_weight_set(pad, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
193 evas_object_size_hint_align_set(pad, EVAS_HINT_FILL, EVAS_HINT_FILL); 207 evas_object_size_hint_align_set(pad, EVAS_HINT_FILL, EVAS_HINT_FILL);
194 elm_object_part_content_set(o, "conf.pad", pad); 208 elm_object_part_content_set(o, POS_PANEL_PAD, pad);
195 evas_object_show(pad); 209 evas_object_show(pad);
196 210
197 elm_table_pack(table, o, 0, 0, 1, 1); 211 elm_table_pack(table, o, 0, 0, 1, 1);
@@ -200,7 +214,7 @@ _content_layout_content_init(Evas_Object *w)
200 evas_object_size_hint_weight_set(bx, 0, 0); 214 evas_object_size_hint_weight_set(bx, 0, 0);
201 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL); 215 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
202 elm_box_horizontal_set(bx, EINA_TRUE); 216 elm_box_horizontal_set(bx, EINA_TRUE);
203 elm_object_part_content_set(o, "conf.controls", bx); 217 elm_object_part_content_set(o, POS_PANEL_CONTROLS, bx);
204 218
205 apply = elm_button_add(w); 219 apply = elm_button_add(w);
206 evas_object_size_hint_weight_set(apply, 0.0, 0.0); 220 evas_object_size_hint_weight_set(apply, 0.0, 0.0);
@@ -242,7 +256,7 @@ _content_layout_content_hide(Evas_Object *w)
242 Evas_Object *shown_content, *shown = evas_object_data_get(w, DK_MAIN_PANEL_SHOWED); 256 Evas_Object *shown_content, *shown = evas_object_data_get(w, DK_MAIN_PANEL_SHOWED);
243 Elm_Settingspane_Item *it = evas_object_data_get(shown, DK_PANEL_ITEM_SHOWN); 257 Elm_Settingspane_Item *it = evas_object_data_get(shown, DK_PANEL_ITEM_SHOWN);
244 258
245 shown_content = elm_object_part_content_get(shown, "conf.content"); 259 shown_content = elm_object_part_content_get(shown, POS_PANEL_CONTENT);
246 ecore_timer_add(2.0, _content_layout_del_cb, shown_content); 260 ecore_timer_add(2.0, _content_layout_del_cb, shown_content);
247 261
248 if (it) 262 if (it)
@@ -266,7 +280,7 @@ _content_layout_content_set(Evas_Object *w, Elm_Settingspane_Item *it)
266 evas_object_show(scroller); 280 evas_object_show(scroller);
267 elm_object_content_set(scroller, new_content); 281 elm_object_content_set(scroller, new_content);
268 282
269 elm_object_part_content_set(hidden, "conf.content", scroller); 283 elm_object_part_content_set(hidden, POS_PANEL_CONTENT, scroller);
270 284
271 elm_widget_signal_emit(hidden, "state,visible", "conf"); 285 elm_widget_signal_emit(hidden, "state,visible", "conf");
272 evas_object_data_set(hidden, DK_PANEL_ITEM_SHOWN, it); 286 evas_object_data_set(hidden, DK_PANEL_ITEM_SHOWN, it);
@@ -304,7 +318,7 @@ _menu_layout_init(Evas_Object *w)
304 evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL); 318 evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
305 elm_genlist_mode_set(list, ELM_LIST_LIMIT); 319 elm_genlist_mode_set(list, ELM_LIST_LIMIT);
306 evas_object_data_set(o, DK_MENU_GENLIST, list); 320 evas_object_data_set(o, DK_MENU_GENLIST, list);
307 elm_object_part_content_set(o, "conf.content", list); 321 elm_object_part_content_set(o, POS_MENU_CONTENT, list);
308 evas_object_show(list); 322 evas_object_show(list);
309 elm_table_pack(table, o, 0, 0, 1, 1); 323 elm_table_pack(table, o, 0, 0, 1, 1);
310 324
@@ -640,7 +654,7 @@ _elm_settingspane_evas_object_smart_add(Eo *obj, Elm_Settingspane_Data *pd)
640 elm_box_horizontal_set(bx, EINA_TRUE); 654 elm_box_horizontal_set(bx, EINA_TRUE);
641 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 655 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
642 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL); 656 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
643 elm_object_part_content_set(obj, "conf.title", bx); 657 elm_object_part_content_set(obj, POS_MAIN_TITLE, bx);
644 evas_object_data_set(obj, DK_MAIN_TITLE_BOX, bx); 658 evas_object_data_set(obj, DK_MAIN_TITLE_BOX, bx);
645 evas_object_show(bx); 659 evas_object_show(bx);
646 660
@@ -648,20 +662,20 @@ _elm_settingspane_evas_object_smart_add(Eo *obj, Elm_Settingspane_Data *pd)
648 elm_entry_single_line_set(en, EINA_TRUE); 662 elm_entry_single_line_set(en, EINA_TRUE);
649 elm_entry_scrollable_set(en, EINA_TRUE); 663 elm_entry_scrollable_set(en, EINA_TRUE);
650 elm_object_part_text_set(en, "guide", "Search"); 664 elm_object_part_text_set(en, "guide", "Search");
651 elm_object_part_content_set(obj, "conf.search", en); 665 elm_object_part_content_set(obj, POS_MAIN_SEARCH, en);
652 evas_object_show(en); 666 evas_object_show(en);
653 667
654 tb1 = elm_table_add(obj); 668 tb1 = elm_table_add(obj);
655 evas_object_size_hint_weight_set(tb1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 669 evas_object_size_hint_weight_set(tb1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
656 evas_object_size_hint_align_set(tb1, EVAS_HINT_FILL, EVAS_HINT_FILL); 670 evas_object_size_hint_align_set(tb1, EVAS_HINT_FILL, EVAS_HINT_FILL);
657 elm_object_part_content_set(obj, "conf.panel", tb1); 671 elm_object_part_content_set(obj, POS_MAIN_PANEL, tb1);
658 evas_object_show(tb1); 672 evas_object_show(tb1);
659 evas_object_data_set(obj, DK_MAIN_PANEL_TABLE, tb1); 673 evas_object_data_set(obj, DK_MAIN_PANEL_TABLE, tb1);
660 674
661 tb2 = elm_table_add(obj); 675 tb2 = elm_table_add(obj);
662 evas_object_size_hint_weight_set(tb2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 676 evas_object_size_hint_weight_set(tb2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
663 evas_object_size_hint_align_set(tb2, EVAS_HINT_FILL, EVAS_HINT_FILL); 677 evas_object_size_hint_align_set(tb2, EVAS_HINT_FILL, EVAS_HINT_FILL);
664 elm_object_part_content_set(obj, "conf.menu", tb2); 678 elm_object_part_content_set(obj, POS_MAIN_MENU, tb2);
665 evas_object_show(tb2); 679 evas_object_show(tb2);
666 evas_object_data_set(obj, DK_MAIN_MENU_TABLE, tb2); 680 evas_object_data_set(obj, DK_MAIN_MENU_TABLE, tb2);
667 681