summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHermet Park <hermet@hermet.pe.kr>2016-02-01 22:35:23 +0900
committerHermet Park <hermet@hermet.pe.kr>2016-02-01 22:37:22 +0900
commit59bca4dfabb9d5d7c2a79d8853f9ac3eac886f54 (patch)
tree2a090db82a5ec52bf3b42c40fdcdab571434f549
parentb3fda027024406306333146de0c5a196b92800cc (diff)
layout: test code refactoring.
remove a comment. pass immediate parents. remove unnecessary show call.
-rw-r--r--src/bin/test_layout.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/bin/test_layout.c b/src/bin/test_layout.c
index 7b33cb4b9..fce1b93cd 100644
--- a/src/bin/test_layout.c
+++ b/src/bin/test_layout.c
@@ -54,7 +54,7 @@ test_layout(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
54 elm_win_resize_object_add(win, box); 54 elm_win_resize_object_add(win, box);
55 evas_object_show(box); 55 evas_object_show(box);
56 56
57 ly = elm_layout_add(win); 57 ly = elm_layout_add(box);
58 58
59 if (!elm_layout_theme_set( 59 if (!elm_layout_theme_set(
60 ly, "layout", "application", "titlebar")) 60 ly, "layout", "application", "titlebar"))
@@ -66,43 +66,39 @@ test_layout(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
66 elm_box_pack_end(box, ly); 66 elm_box_pack_end(box, ly);
67 evas_object_show(ly); 67 evas_object_show(ly);
68 68
69 bt = elm_icon_add(win); 69 bt = elm_icon_add(ly);
70 elm_icon_standard_set(bt, "chat"); 70 elm_icon_standard_set(bt, "chat");
71 evas_object_size_hint_min_set(bt, 20, 20); 71 evas_object_size_hint_min_set(bt, 20, 20);
72 elm_layout_icon_set(ly, bt); 72 elm_layout_icon_set(ly, bt);
73 73
74 bt = elm_icon_add(win); 74 bt = elm_icon_add(ly);
75 elm_icon_standard_set(bt, "close"); 75 elm_icon_standard_set(bt, "close");
76 evas_object_size_hint_min_set(bt, 20, 20); 76 evas_object_size_hint_min_set(bt, 20, 20);
77 elm_layout_end_set(ly, bt); 77 elm_layout_end_set(ly, bt);
78 78
79 ly = elm_layout_add(win); 79 ly = elm_layout_add(box);
80 snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get()); 80 snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get());
81 elm_layout_file_set(ly, buf, "layout"); 81 elm_layout_file_set(ly, buf, "layout");
82 evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 82 evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
83 elm_box_pack_end(box, ly); 83 elm_box_pack_end(box, ly);
84 //elm_win_resize_object_add(win, ly);
85 evas_object_show(ly); 84 evas_object_show(ly);
86 85
87 elm_layout_signal_callback_add(ly, "*", "*", _cb_signal, NULL); 86 elm_layout_signal_callback_add(ly, "*", "*", _cb_signal, NULL);
88 87
89 bt = elm_button_add(win); 88 bt = elm_button_add(ly);
90 elm_object_text_set(bt, "Button 1"); 89 elm_object_text_set(bt, "Button 1");
91 elm_object_part_content_set(ly, "element1", bt); 90 elm_object_part_content_set(ly, "element1", bt);
92 evas_object_smart_callback_add(bt, "clicked", _clicked_cb, ly); 91 evas_object_smart_callback_add(bt, "clicked", _clicked_cb, ly);
93 evas_object_show(bt);
94 92
95 bt = elm_button_add(win); 93 bt = elm_button_add(ly);
96 elm_object_text_set(bt, "Button 2"); 94 elm_object_text_set(bt, "Button 2");
97 elm_object_part_content_set(ly, "element2", bt); 95 elm_object_part_content_set(ly, "element2", bt);
98 evas_object_smart_callback_add(bt, "clicked", _clicked_cb, ly); 96 evas_object_smart_callback_add(bt, "clicked", _clicked_cb, ly);
99 evas_object_show(bt);
100 97
101 bt = elm_button_add(win); 98 bt = elm_button_add(ly);
102 elm_object_text_set(bt, "Button 3"); 99 elm_object_text_set(bt, "Button 3");
103 elm_object_part_content_set(ly, "element3", bt); 100 elm_object_part_content_set(ly, "element3", bt);
104 evas_object_smart_callback_add(bt, "clicked", _clicked_cb, ly); 101 evas_object_smart_callback_add(bt, "clicked", _clicked_cb, ly);
105 evas_object_show(bt);
106 102
107 elm_layout_part_cursor_set(ly, "text", ELM_CURSOR_WATCH); 103 elm_layout_part_cursor_set(ly, "text", ELM_CURSOR_WATCH);
108 104