summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-11-09 18:58:32 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-11-09 18:58:32 +0000
commit620a0a1ac7cabaa6a60b6db2800258b81308f8a0 (patch)
tree1f767b312c0ef589f56d5376e02a8c19b6b5ef14
parentb25a7d2816bf7ba17465c6a532c2a320e0e2f6b0 (diff)
ephysics: toggle theme
SVN revision: 79054
-rw-r--r--legacy/ephysics/data/themes/Makefile.am7
-rw-r--r--legacy/ephysics/data/themes/ephysics_test.edc1
-rw-r--r--legacy/ephysics/data/themes/images/tog_base_off.pngbin0 -> 2114 bytes
-rw-r--r--legacy/ephysics/data/themes/images/tog_base_on.pngbin0 -> 2184 bytes
-rw-r--r--legacy/ephysics/data/themes/images/tog_bt_off.pngbin0 -> 1989 bytes
-rw-r--r--legacy/ephysics/data/themes/images/tog_bt_on.pngbin0 -> 2056 bytes
-rw-r--r--legacy/ephysics/data/themes/toggle.edc399
-rw-r--r--legacy/ephysics/src/bin/test_flag.c2
-rw-r--r--legacy/ephysics/src/bin/test_light.c2
9 files changed, 408 insertions, 3 deletions
diff --git a/legacy/ephysics/data/themes/Makefile.am b/legacy/ephysics/data/themes/Makefile.am
index 73a26f5ab4..11d2fd2dff 100644
--- a/legacy/ephysics/data/themes/Makefile.am
+++ b/legacy/ephysics/data/themes/Makefile.am
@@ -24,6 +24,7 @@ TEST_FILES = \
24 shadows.edc \ 24 shadows.edc \
25 shapes.edc \ 25 shapes.edc \
26 spinner.edc \ 26 spinner.edc \
27 toggle.edc \
27 images/arrows.png \ 28 images/arrows.png \
28 images/background.jpg \ 29 images/background.jpg \
29 images/ball-blue.png \ 30 images/ball-blue.png \
@@ -69,7 +70,11 @@ TEST_FILES = \
69 images/spinner_bt_left_pressed.png \ 70 images/spinner_bt_left_pressed.png \
70 images/spinner_bt_right.png \ 71 images/spinner_bt_right.png \
71 images/spinner_bt_right_pressed.png \ 72 images/spinner_bt_right_pressed.png \
72 images/star.png 73 images/star.png \
74 images/tog_base_off.png \
75 images/tog_base_on.png \
76 images/tog_bt_off.png \
77 images/tog_bt_on.png
73 78
74SANDBOX_FILES = \ 79SANDBOX_FILES = \
75 ephysics_sandbox.edc \ 80 ephysics_sandbox.edc \
diff --git a/legacy/ephysics/data/themes/ephysics_test.edc b/legacy/ephysics/data/themes/ephysics_test.edc
index f0bec3e4ac..6cc6a67c29 100644
--- a/legacy/ephysics/data/themes/ephysics_test.edc
+++ b/legacy/ephysics/data/themes/ephysics_test.edc
@@ -13,5 +13,6 @@ collections {
13#include "shadows.edc" 13#include "shadows.edc"
14#include "shapes.edc" 14#include "shapes.edc"
15#include "spinner.edc" 15#include "spinner.edc"
16#include "toggle.edc"
16#include "others.edc" 17#include "others.edc"
17} 18}
diff --git a/legacy/ephysics/data/themes/images/tog_base_off.png b/legacy/ephysics/data/themes/images/tog_base_off.png
new file mode 100644
index 0000000000..1381e2a51f
--- /dev/null
+++ b/legacy/ephysics/data/themes/images/tog_base_off.png
Binary files differ
diff --git a/legacy/ephysics/data/themes/images/tog_base_on.png b/legacy/ephysics/data/themes/images/tog_base_on.png
new file mode 100644
index 0000000000..f2cdcf18a0
--- /dev/null
+++ b/legacy/ephysics/data/themes/images/tog_base_on.png
Binary files differ
diff --git a/legacy/ephysics/data/themes/images/tog_bt_off.png b/legacy/ephysics/data/themes/images/tog_bt_off.png
new file mode 100644
index 0000000000..8b6a0bb609
--- /dev/null
+++ b/legacy/ephysics/data/themes/images/tog_bt_off.png
Binary files differ
diff --git a/legacy/ephysics/data/themes/images/tog_bt_on.png b/legacy/ephysics/data/themes/images/tog_bt_on.png
new file mode 100644
index 0000000000..0efa038d27
--- /dev/null
+++ b/legacy/ephysics/data/themes/images/tog_bt_on.png
Binary files differ
diff --git a/legacy/ephysics/data/themes/toggle.edc b/legacy/ephysics/data/themes/toggle.edc
new file mode 100644
index 0000000000..becd374265
--- /dev/null
+++ b/legacy/ephysics/data/themes/toggle.edc
@@ -0,0 +1,399 @@
1group {
2 name: "elm/check/base/ephysics-test";
3
4 images {
5 image: "tog_base_on.png" COMP;
6 image: "tog_base_off.png" COMP;
7 image: "tog_bt_on.png" COMP;
8 image: "tog_bt_off.png" COMP;
9 }
10
11 script {
12 public is_rtl;
13 public is_drag;
14 public was_drag;
15 }
16
17 parts {
18
19 part { name: "bg";
20 type: RECT;
21 mouse_events: 0;
22 scale: 1;
23 description { state: "default" 0.0;
24 fixed: 1 0;
25 rel1.relative: 1.0 0.0;
26 rel1.offset: -4 3;
27 rel2.offset: -4 -4;
28 align: 1.0 0.5;
29 min: 100 26;
30 max: 100 26;
31 visible: 0;
32 }
33 }
34
35 part {
36 name: "clipper";
37 type: RECT;
38 mouse_events: 0;
39 description {
40 state: "default" 0.0;
41 rel1.to: "bg";
42 rel2.to: "bg";
43 color: 255 255 255 255;
44 }
45 }
46
47 part {
48 name: "button";
49 type: RECT;
50 scale: 1;
51 clip_to: "clipper";
52 mouse_events: 1;
53 dragable {
54 x: 1 1 0;
55 y: 0 0 0;
56 confine: "bg";
57 }
58 description {
59 state: "default" 0.0;
60 fixed: 1 1;
61 rel1.to: "bg";
62 rel2.to: "bg";
63 min: 28 24;
64 max: 28 24;
65 aspect: 1.0 1.0;
66 aspect_preference: VERTICAL;
67 color: 0 0 0 0;
68 }
69 }
70
71 part {
72 name: "button_events";
73 type: RECT;
74 dragable {
75 events: "button";
76 }
77 description {
78 state: "default" 0.0;
79 color: 0 0 0 0;
80 }
81 }
82
83 part {
84 name: "onrect";
85 type: IMAGE;
86 scale: 1;
87 clip_to: "clipper";
88 mouse_events: 0;
89 description {
90 state: "default" 0.0;
91 rel1.to: "button";
92 rel1.relative: 1.0 0.0;
93 rel2.to: "button";
94 rel2.relative: 1.0 1.0;
95 fixed: 1 1;
96 align: 1 0.5;
97 min: 100 26;
98 max: 100 26;
99 image.normal: "tog_base_on.png";
100 }
101 }
102
103 part {
104 name: "offrect";
105 type: IMAGE;
106 scale: 1;
107 clip_to: "clipper";
108 mouse_events: 0;
109 description {
110 state: "default" 0.0;
111 rel1.to: "button";
112 rel1.relative: 0 0.0;
113 rel2.to: "button";
114 rel2.relative: 0 1.0;
115 fixed: 1 1;
116 align: 0 0.5;
117 min: 100 26;
118 max: 100 26;
119 image.normal: "tog_base_off.png";
120 }
121 }
122
123 part {
124 name: "button0";
125 type: IMAGE;
126 clip_to: "clipper";
127 mouse_events: 0;
128 description {
129 state: "default" 0.0;
130 rel1.to: "button";
131 rel2.to: "button";
132 image.normal: "tog_bt_on.png";
133 }
134 description {
135 state: "on" 0.0;
136 inherit: "default" 0.0;
137 }
138 description {
139 state: "off" 0.0;
140 inherit: "default" 0.0;
141 image.normal: "tog_bt_off.png";
142 }
143 }
144
145 part {
146 name: "elm.offtext";
147 type: TEXT;
148 mouse_events: 0;
149 scale: 1;
150 clip_to: "clipper";
151 description {
152 state: "default" 0.0;
153 fixed: 1 1;
154 rel1.to_x: "button";
155 rel1.relative: 1.0 0.0;
156 rel2.to_x: "offrect";
157 color: 0 0 0 255;
158 text {
159 font: "Sans,Edje-Vera";
160 size: 10;
161 min: 0 1;
162 align: 0.5 0.5;
163 }
164 }
165 }
166
167 part {
168 name: "elm.ontext";
169 type: TEXT;
170 effect: SOFT_SHADOW;
171 mouse_events: 0;
172 scale: 1;
173 clip_to: "clipper";
174 description {
175 state: "default" 0.0;
176 fixed: 1 1;
177 rel1.to_x: "onrect";
178 rel1.offset: 1 1;
179 rel2.to_x: "button";
180 rel2.offset: 0 0;
181 rel2.relative: 0.0 1.0;
182 color: 224 224 224 255;
183 color3: 0 0 0 64;
184 text {
185 font: "Sans,Edje-Vera";
186 size: 10;
187 min: 0 1;
188 align: 0.5 0.5;
189 }
190 }
191 }
192
193 part {
194 name: "elm.swallow.content";
195 type: SWALLOW;
196 description {
197 state: "default" 0.0;
198 fixed: 1 0;
199 visible: 0;
200 align: 0.0 0.5;
201 rel1.offset: 4 4;
202 rel2.relative: 0.0 1.0;
203 rel2.offset: 3 -5;
204 }
205 description {
206 state: "visible" 0.0;
207 inherit: "default" 0.0;
208 visible: 1;
209 aspect: 1.0 1.0;
210 rel2.offset: 4 -5;
211 }
212 }
213
214 part {
215 name: "elm.text";
216 type: TEXT;
217 mouse_events: 0;
218 scale: 1;
219 description {
220 state: "default" 0.0;
221 visible: 0;
222 rel1.to_x: "elm.swallow.content";
223 rel1.relative: 1.0 0.0;
224 rel1.offset: 0 4;
225 rel2.to_x: "bg";
226 rel2.relative: 0.0 1.0;
227 rel2.offset: -7 -5;
228 color: 0 0 0 255;
229 text {
230 font: "Sans,Edje-Vera";
231 size: 10;
232 min: 0 0;
233 align: 0.0 0.5;
234 }
235 }
236 description {
237 state: "visible" 0.0;
238 inherit: "default" 0.0;
239 visible: 1;
240 text.min: 1 1;
241 }
242 }
243
244 }
245
246 programs {
247
248 program {
249 signal: "mouse,clicked,1";
250 source: "button";
251 script {
252 new Float:dx, Float:dy;
253 get_drag(PART:"button", dx, dy);
254
255 if (!get_int(was_drag)) {
256 if (dx > 0.5)
257 set_drag(PART:"button", 0.0, 0.0);
258 else
259 set_drag(PART:"button", 1.0, 0.0);
260 if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
261 (get_int(is_rtl) == 0) && (dx > 0.5))
262 emit("elm,action,check,off", "");
263 else
264 emit("elm,action,check,on", "");
265 }
266 }
267 }
268
269 program {
270 signal: "drag";
271 source: "button";
272 script {
273 set_int(is_drag, 1);
274 }
275 }
276
277 program {
278 signal: "mouse,down,1";
279 source: "button";
280 script {
281 set_int(was_drag, 0);
282 set_int(is_drag, 0);
283 }
284 }
285
286 program {
287 name: "drag_end";
288 signal: "mouse,up,1";
289 source: "button";
290 script {
291 new Float:dx, Float:dy;
292 get_drag(PART:"button", dx, dy);
293 if (dx > 0.5)
294 {
295 set_drag(PART:"button", 1.0, 0.0);
296 }
297 else
298 {
299 set_drag(PART:"button", 0.0, 0.0);
300 }
301 if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
302 (get_int(is_rtl) == 0) && (dx > 0.5)) {
303 emit("elm,action,check,on", "");
304 }
305 else {
306 emit("elm,action,check,off", "");
307 }
308 set_int(was_drag, get_int(is_drag));
309 set_int(is_drag, 0);
310 }
311 }
312
313 program {
314 name: "check_on";
315 signal: "elm,state,check,on";
316 source: "elm";
317 script {
318 new Float:drag;
319 if (get_int(is_rtl) == 0) {
320 drag = 100.0;
321 }
322 else {
323 drag = 0.0;
324 }
325 set_drag(PART:"button", drag, 0.0);
326 set_state(PART:"button0", "on", 0.0);
327 }
328 }
329
330 program {
331 name: "check_off";
332 signal: "elm,state,check,off";
333 source: "elm";
334 script {
335 new Float:drag;
336 if (get_int(is_rtl) == 0) {
337 drag = 0.0;
338 }
339 else {
340 drag = 100.0;
341 }
342 set_drag(PART:"button", drag, 0.0);
343 set_state(PART:"button0", "off", 0.0);
344 }
345 }
346
347 program {
348 name: "text_show";
349 signal: "elm,state,text,visible";
350 source: "elm";
351 action: STATE_SET "visible" 0.0;
352 target: "elm.text";
353 }
354
355 program {
356 name: "text_hide";
357 signal: "elm,state,text,hidden";
358 source: "elm";
359 action: STATE_SET "default" 0.0;
360 target: "elm.text";
361 }
362
363 program {
364 name: "icon_show";
365 signal: "elm,state,icon,visible";
366 source: "elm";
367 action: STATE_SET "visible" 0.0;
368 target: "elm.swallow.content";
369 }
370
371 program {
372 name: "icon_hide";
373 signal: "elm,state,icon,hidden";
374 source: "elm";
375 action: STATE_SET "default" 0.0;
376 target: "elm.swallow.content";
377 }
378
379 program {
380 name: "to_rtl";
381 signal: "edje,state,rtl";
382 source: "edje";
383 script {
384 set_int(is_rtl, 1);
385 }
386 }
387
388 program {
389 name: "to_ltr";
390 signal: "edje,state,ltr";
391 source: "edje";
392 script {
393 set_int(is_rtl, 0);
394 }
395 }
396
397 }
398
399}
diff --git a/legacy/ephysics/src/bin/test_flag.c b/legacy/ephysics/src/bin/test_flag.c
index 9a6d68b477..17cb5502ed 100644
--- a/legacy/ephysics/src/bin/test_flag.c
+++ b/legacy/ephysics/src/bin/test_flag.c
@@ -162,7 +162,7 @@ test_flag(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info _
162 elm_object_signal_emit(test_data->layout, "borders,show", "ephysics_test"); 162 elm_object_signal_emit(test_data->layout, "borders,show", "ephysics_test");
163 163
164 tg = elm_check_add(test_data->win); 164 tg = elm_check_add(test_data->win);
165 elm_object_style_set(tg, "toggle"); 165 elm_object_style_set(tg, "ephysics-test");
166 evas_object_size_hint_weight_set(tg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 166 evas_object_size_hint_weight_set(tg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
167 evas_object_size_hint_align_set(tg, EVAS_HINT_FILL, 0.5); 167 evas_object_size_hint_align_set(tg, EVAS_HINT_FILL, 0.5);
168 elm_check_state_set(tg, EINA_TRUE); 168 elm_check_state_set(tg, EINA_TRUE);
diff --git a/legacy/ephysics/src/bin/test_light.c b/legacy/ephysics/src/bin/test_light.c
index 91250c931a..240e8f4ba9 100644
--- a/legacy/ephysics/src/bin/test_light.c
+++ b/legacy/ephysics/src/bin/test_light.c
@@ -75,7 +75,7 @@ test_light(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
75 elm_object_signal_emit(test_data->layout, "borders,show", "ephysics_test"); 75 elm_object_signal_emit(test_data->layout, "borders,show", "ephysics_test");
76 76
77 tg = elm_check_add(test_data->win); 77 tg = elm_check_add(test_data->win);
78 elm_object_style_set(tg, "toggle"); 78 elm_object_style_set(tg, "ephysics-test");
79 evas_object_size_hint_weight_set(tg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 79 evas_object_size_hint_weight_set(tg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
80 evas_object_size_hint_align_set(tg, EVAS_HINT_FILL, 0.5); 80 evas_object_size_hint_align_set(tg, EVAS_HINT_FILL, 0.5);
81 elm_check_state_set(tg, EINA_TRUE); 81 elm_check_state_set(tg, EINA_TRUE);