summaryrefslogtreecommitdiff
path: root/src/bin/elementary
diff options
context:
space:
mode:
authorWoochan Lee <wc0917.lee@samsung.com>2017-11-28 20:02:53 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-11-28 20:02:53 +0900
commit434be7dbfa708247baec25ddc300201185c2110f (patch)
tree34ae87d3bd66b8fba849ad3e77e9a60b851393fc /src/bin/elementary
parenta3ad64dcd03a523050356e01c2f267442f07fdb6 (diff)
test_part_bg: Clean up code.
Summary: Add spin class in ther test list. Clean up code. Reviewers: Jaehyun_Cho, jpeg, taxi2se Reviewed By: Jaehyun_Cho Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D5545
Diffstat (limited to '')
-rw-r--r--src/bin/elementary/test_part_bg.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/src/bin/elementary/test_part_bg.c b/src/bin/elementary/test_part_bg.c
index cdad4845f7..26ba4dc7eb 100644
--- a/src/bin/elementary/test_part_bg.c
+++ b/src/bin/elementary/test_part_bg.c
@@ -3,7 +3,9 @@
3#endif 3#endif
4#include <Elementary.h> 4#include <Elementary.h>
5 5
6const Efl_Class *content_class[17]; 6#define MAX_NUM_OF_CONTENT 18
7
8const Efl_Class *content_class[MAX_NUM_OF_CONTENT];
7 9
8 10
9static void 11static void
@@ -65,12 +67,12 @@ _create_box_contents(Evas_Object *box)
65 efl_pack_end(box, efl_added)); 67 efl_pack_end(box, efl_added));
66 68
67 radio_group = radio = efl_add(EFL_UI_RADIO_CLASS, hbox, 69 radio_group = radio = efl_add(EFL_UI_RADIO_CLASS, hbox,
68 efl_pack_end(hbox, efl_added), 70 efl_pack_end(hbox, efl_added),
69 efl_gfx_size_hint_weight_set(efl_added, 0, 0), 71 efl_gfx_size_hint_weight_set(efl_added, 0, 0),
70 efl_ui_radio_state_value_set(efl_added, 0)); 72 efl_ui_radio_state_value_set(efl_added, 0));
71 73
72 content = efl_add(EFL_UI_BOX_CLASS, hbox, 74 content = efl_add(EFL_UI_BOX_CLASS, hbox,
73 efl_pack_end(hbox, efl_added)); 75 efl_pack_end(hbox, efl_added));
74 evas_object_data_set(radio, "data", content); 76 evas_object_data_set(radio, "data", content);
75 77
76 content = efl_add(EFL_UI_TEXT_CLASS, content, 78 content = efl_add(EFL_UI_TEXT_CLASS, content,
@@ -78,23 +80,23 @@ _create_box_contents(Evas_Object *box)
78 efl_ui_text_interactive_editable_set(efl_added, EINA_FALSE), 80 efl_ui_text_interactive_editable_set(efl_added, EINA_FALSE),
79 efl_pack_end(content, efl_added)); 81 efl_pack_end(content, efl_added));
80 82
81 for (i = 0; i < (sizeof(content_class) / sizeof(content_class[0])) ; i++) 83 for (i = 0; i < MAX_NUM_OF_CONTENT; i++)
82 { 84 {
83 if (!content_class[i]) continue; 85 if (!content_class[i]) continue;
84 86
85 hbox = efl_add(EFL_UI_BOX_CLASS, box, 87 hbox = efl_add(EFL_UI_BOX_CLASS, box,
86 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), 88 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
87 efl_pack_end(box, efl_added)); 89 efl_pack_end(box, efl_added));
88 90
89 radio = efl_add(EFL_UI_RADIO_CLASS, hbox, 91 radio = efl_add(EFL_UI_RADIO_CLASS, hbox,
90 efl_ui_radio_group_add(efl_added, radio_group), 92 efl_ui_radio_group_add(efl_added, radio_group),
91 efl_pack_end(hbox, efl_added), 93 efl_pack_end(hbox, efl_added),
92 efl_ui_radio_state_value_set(efl_added, i + 1), 94 efl_ui_radio_state_value_set(efl_added, i + 1),
93 efl_gfx_size_hint_weight_set(efl_added, 0, 0) 95 efl_gfx_size_hint_weight_set(efl_added, 0, 0));
94 );
95 96
96 content = efl_add(content_class[i], hbox, 97 content = efl_add(content_class[i], hbox,
97 efl_pack_end(hbox, efl_added)); 98 efl_pack_end(hbox, efl_added));
99
98 if (efl_isa(content, efl_text_interface_get())) 100 if (efl_isa(content, efl_text_interface_get()))
99 efl_text_set(content, "text"); 101 efl_text_set(content, "text");
100 102
@@ -138,30 +140,30 @@ test_part_background(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
138 content_class[14] = EFL_UI_IMAGE_CLASS; 140 content_class[14] = EFL_UI_IMAGE_CLASS;
139 content_class[15] = EFL_UI_IMAGE_ZOOMABLE_CLASS; 141 content_class[15] = EFL_UI_IMAGE_ZOOMABLE_CLASS;
140 content_class[16] = EFL_UI_NSTATE_CLASS; 142 content_class[16] = EFL_UI_NSTATE_CLASS;
141 //content_class[17] = EFL_UI_SPINNER_CLASS; 143 content_class[17] = EFL_UI_SPIN_CLASS;
142 144
143 win = efl_add(EFL_UI_WIN_CLASS, NULL, 145 win = efl_add(EFL_UI_WIN_CLASS, NULL,
144 efl_text_set(efl_added, "Widget Part Background"), 146 efl_text_set(efl_added, "Widget Part Background"),
145 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 147 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
146 148
147 vbox = efl_add(EFL_UI_BOX_CLASS, win, 149 vbox = efl_add(EFL_UI_BOX_CLASS, win,
148 efl_gfx_size_hint_weight_set(efl_added, 1, 1), 150 efl_gfx_size_hint_weight_set(efl_added, 1, 1),
149 efl_content_set(win, efl_added)); 151 efl_content_set(win, efl_added));
150 152
151 hbox = efl_add(EFL_UI_BOX_CLASS, vbox, 153 hbox = efl_add(EFL_UI_BOX_CLASS, vbox,
152 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), 154 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
153 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), 155 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
154 efl_pack_end(vbox, efl_added)); 156 efl_pack_end(vbox, efl_added));
155 157
156 reset_btn = efl_add(EFL_UI_BUTTON_CLASS, hbox, 158 reset_btn = efl_add(EFL_UI_BUTTON_CLASS, hbox,
157 efl_pack_end(hbox, efl_added), 159 efl_pack_end(hbox, efl_added),
158 efl_text_set(efl_added, "reset")); 160 efl_text_set(efl_added, "reset"));
159 color_btn = efl_add(EFL_UI_BUTTON_CLASS, hbox, 161 color_btn = efl_add(EFL_UI_BUTTON_CLASS, hbox,
160 efl_pack_end(hbox, efl_added), 162 efl_pack_end(hbox, efl_added),
161 efl_text_set(efl_added, "color")); 163 efl_text_set(efl_added, "color"));
162 scale_btn = efl_add(EFL_UI_BUTTON_CLASS, hbox, 164 scale_btn = efl_add(EFL_UI_BUTTON_CLASS, hbox,
163 efl_pack_end(hbox, efl_added), 165 efl_pack_end(hbox, efl_added),
164 efl_text_set(efl_added, "scale_type")); 166 efl_text_set(efl_added, "scale_type"));
165 167
166 scr = elm_scroller_add(vbox); 168 scr = elm_scroller_add(vbox);
167 evas_object_show(scr); 169 evas_object_show(scr);
@@ -170,8 +172,8 @@ test_part_background(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
170 efl_pack_end(vbox, scr); 172 efl_pack_end(vbox, scr);
171 173
172 vbox = efl_add(EFL_UI_BOX_CLASS, scr, 174 vbox = efl_add(EFL_UI_BOX_CLASS, scr,
173 efl_gfx_size_hint_weight_set(efl_added, 1, 1), 175 efl_gfx_size_hint_weight_set(efl_added, 1, 1),
174 efl_content_set(scr, efl_added)); 176 efl_content_set(scr, efl_added));
175 177
176 radio_group = _create_box_contents(vbox); 178 radio_group = _create_box_contents(vbox);
177 179