summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2010-12-07 05:15:05 +0000
committerCarsten Haitzler <raster@rasterman.com>2010-12-07 05:15:05 +0000
commite7c053acd7092ca549e3e0ecad4d3eb4f14046fa (patch)
tree2e3a66cf4aeb77f00e7e6ad6fd915fc543af35d7 /src/bin
parent3d4852d756f00a39e6f9bd172ba3152ebf78933f (diff)
From: Jihoon Kim <jihoon48.kim@samsung.com>
Subject: [E-devel] [PATCH] elm_slider patch for disable state elm_slider does not support disable state, so I make this patch. Please review it and upload in svn if it is ok. (nb - also fixed vertical slider sizing in defaul theme and changed jihoons changes to slider test to make the vertical sliders in a horizontal box so they dont get silly long windows) SVN revision: 55340
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/test_slider.c82
1 files changed, 76 insertions, 6 deletions
diff --git a/src/bin/test_slider.c b/src/bin/test_slider.c
index e17b67b8f..67d5a1785 100644
--- a/src/bin/test_slider.c
+++ b/src/bin/test_slider.c
@@ -14,7 +14,7 @@ _change_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
14void 14void
15test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 15test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
16{ 16{
17 Evas_Object *win, *bg, *bx, *sl, *ic, *sl1; 17 Evas_Object *win, *bg, *bx, *sl, *ic, *sl1, *bx2;
18 char buf[PATH_MAX]; 18 char buf[PATH_MAX];
19 19
20 win = elm_win_add(NULL, "slider", ELM_WIN_BASIC); 20 win = elm_win_add(NULL, "slider", ELM_WIN_BASIC);
@@ -48,6 +48,24 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
48 evas_object_show(ic); 48 evas_object_show(ic);
49 evas_object_show(sl); 49 evas_object_show(sl);
50 50
51 /* horizontal disable state */
52 ic = elm_icon_add(win);
53 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
54 elm_icon_file_set(ic, buf, NULL);
55 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
56
57 sl = elm_slider_add(win);
58 elm_slider_label_set(sl, "Disabled");
59 elm_slider_icon_set(sl, ic);
60 elm_slider_unit_format_set(sl, "%1.1f units");
61 elm_slider_span_size_set(sl, 120);
62 elm_object_disabled_set(sl, EINA_TRUE);
63 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
64 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
65 elm_box_pack_end(bx, sl);
66 evas_object_show(ic);
67 evas_object_show(sl);
68
51 ic = elm_icon_add(win); 69 ic = elm_icon_add(win);
52 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); 70 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
53 elm_icon_file_set(ic, buf, NULL); 71 elm_icon_file_set(ic, buf, NULL);
@@ -62,7 +80,30 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
62 elm_slider_indicator_format_set(sl, "%3.0f"); 80 elm_slider_indicator_format_set(sl, "%3.0f");
63 elm_slider_min_max_set(sl, 50, 150); 81 elm_slider_min_max_set(sl, 50, 150);
64 elm_slider_value_set(sl, 80); 82 elm_slider_value_set(sl, 80);
65 elm_slider_inverted_set(sl, 1); 83 elm_slider_inverted_set(sl, EINA_TRUE);
84 evas_object_size_hint_align_set(sl, 0.5, 0.5);
85 evas_object_size_hint_weight_set(sl, 0.0, 0.0);
86 elm_box_pack_end(bx, sl);
87 evas_object_show(ic);
88 evas_object_show(sl);
89
90 /* label2 disable */
91 ic = elm_icon_add(win);
92 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
93 elm_icon_file_set(ic, buf, NULL);
94 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
95
96 sl = elm_slider_add(win);
97 elm_slider_label_set(sl, "Disabled inverted");
98 elm_slider_end_set(sl, ic);
99 elm_slider_span_size_set(sl, 80);
100 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
101 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
102 elm_slider_indicator_format_set(sl, "%3.0f");
103 elm_slider_min_max_set(sl, 50, 150);
104 elm_slider_value_set(sl, 80);
105 elm_slider_inverted_set(sl, EINA_TRUE);
106 elm_object_disabled_set(sl, EINA_TRUE);
66 evas_object_size_hint_align_set(sl, 0.5, 0.5); 107 evas_object_size_hint_align_set(sl, 0.5, 0.5);
67 evas_object_size_hint_weight_set(sl, 0.0, 0.0); 108 evas_object_size_hint_weight_set(sl, 0.0, 0.0);
68 elm_box_pack_end(bx, sl); 109 elm_box_pack_end(bx, sl);
@@ -79,12 +120,18 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
79 elm_slider_indicator_format_set(sl, "%3.0f"); 120 elm_slider_indicator_format_set(sl, "%3.0f");
80 elm_slider_min_max_set(sl, 50, 150); 121 elm_slider_min_max_set(sl, 50, 150);
81 elm_slider_value_set(sl, 80); 122 elm_slider_value_set(sl, 80);
82 elm_slider_inverted_set(sl, 1); 123 elm_slider_inverted_set(sl, EINA_TRUE);
83 elm_object_scale_set(sl, 2.0); 124 elm_object_scale_set(sl, 2.0);
84 elm_box_pack_end(bx, sl); 125 elm_box_pack_end(bx, sl);
85 evas_object_show(ic); 126 evas_object_show(ic);
86 evas_object_show(sl); 127 evas_object_show(sl);
87 128
129 bx2 = elm_box_add(win);
130 evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
131 elm_box_horizontal_set(bx2, EINA_TRUE);
132 elm_box_pack_end(bx, bx2);
133 evas_object_show(bx2);
134
88 ic = elm_icon_add(win); 135 ic = elm_icon_add(win);
89 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); 136 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
90 elm_icon_file_set(ic, buf, NULL); 137 elm_icon_file_set(ic, buf, NULL);
@@ -93,7 +140,7 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
93 sl = elm_slider_add(win); 140 sl = elm_slider_add(win);
94 elm_slider_icon_set(sl, ic); 141 elm_slider_icon_set(sl, ic);
95 elm_slider_label_set(sl, "Vertical inverted"); 142 elm_slider_label_set(sl, "Vertical inverted");
96 elm_slider_inverted_set(sl, 1); 143 elm_slider_inverted_set(sl, EINA_TRUE);
97 elm_slider_unit_format_set(sl, "units"); 144 elm_slider_unit_format_set(sl, "units");
98 elm_slider_span_size_set(sl, 60); 145 elm_slider_span_size_set(sl, 60);
99 evas_object_size_hint_align_set(sl, 0.5, EVAS_HINT_FILL); 146 evas_object_size_hint_align_set(sl, 0.5, EVAS_HINT_FILL);
@@ -102,7 +149,7 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
102 elm_slider_value_set(sl, 0.2); 149 elm_slider_value_set(sl, 0.2);
103 elm_object_scale_set(sl, 1.0); 150 elm_object_scale_set(sl, 1.0);
104 elm_slider_horizontal_set(sl, 0); 151 elm_slider_horizontal_set(sl, 0);
105 elm_box_pack_end(bx, sl); 152 elm_box_pack_end(bx2, sl);
106 evas_object_show(ic); 153 evas_object_show(ic);
107 evas_object_show(sl); 154 evas_object_show(sl);
108 155
@@ -118,10 +165,33 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
118 elm_slider_value_set(sl, 0.2); 165 elm_slider_value_set(sl, 0.2);
119 elm_object_scale_set(sl, 1.0); 166 elm_object_scale_set(sl, 1.0);
120 elm_slider_horizontal_set(sl, EINA_FALSE); 167 elm_slider_horizontal_set(sl, EINA_FALSE);
121 elm_box_pack_end(bx, sl); 168 elm_box_pack_end(bx2, sl);
122 evas_object_show(ic); 169 evas_object_show(ic);
123 evas_object_show(sl); 170 evas_object_show(sl);
124 171
172 /* vertical disable state */
173 ic = elm_icon_add(win);
174 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
175 elm_icon_file_set(ic, buf, NULL);
176 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_HORIZONTAL, 1, 1);
177
178 sl = elm_slider_add(win);
179 elm_slider_icon_set(sl, ic);
180 elm_slider_label_set(sl, "Disabled vertical");
181 elm_slider_inverted_set(sl, EINA_TRUE);
182 elm_slider_unit_format_set(sl, "units");
183 elm_slider_span_size_set(sl, 100);
184 evas_object_size_hint_align_set(sl, 0.5, EVAS_HINT_FILL);
185 evas_object_size_hint_weight_set(sl, 0.0, EVAS_HINT_EXPAND);
186 elm_slider_indicator_format_set(sl, "%1.1f");
187 elm_slider_value_set(sl, 0.2);
188 elm_object_scale_set(sl, 1.0);
189 elm_slider_horizontal_set(sl, 0);
190 elm_object_disabled_set(sl, EINA_TRUE);
191 elm_box_pack_end(bx2, sl);
192 evas_object_show(ic);
193 evas_object_show(sl);
194
125 evas_object_show(win); 195 evas_object_show(win);
126} 196}
127#endif 197#endif