1 group { name: "elm/check/base/toggle";
2 alias: "elm/toggle/base/default";
4 image: "shelf_inset.png" COMP;
5 image: "bt_basew.png" COMP;
6 image: "bt_bases.png" COMP;
7 image: "bt_hilightw.png" COMP;
8 image: "tog_base_on.png" COMP;
9 image: "tog_base_off.png" COMP;
10 image: "tog_dis_base_on.png" COMP;
11 image: "tog_dis_base_off.png" COMP;
21 description { state: "default" 0.0;
22 rel1.relative: 1.0 0.0;
29 aspect_preference: VERTICAL;
30 color: 255 255 255 255;
33 part { name: "clipper";
36 description { state: "default" 0.0;
39 color: 255 255 255 255;
42 part { name: "button";
52 description { state: "default" 0.0;
59 aspect_preference: VERTICAL;
63 part { name: "button_events";
68 description { state: "default" 0.0;
71 rel1.relative: 0.0 0.0;
74 rel2.relative: 1.0 1.0;
78 part { name: "onrect";
83 description { state: "default" 0.0;
85 rel1.relative: -5.0 0.0;
87 rel2.relative: 0.5 1.0;
88 image.normal: "tog_base_on.png";
90 description { state: "disabled" 0.0;
91 inherit: "default" 0.0;
92 image.normal: "tog_dis_base_on.png";
95 part { name: "offrect";
100 description { state: "default" 0.0;
102 rel1.relative: 0.5 0.0;
104 rel2.relative: 6.0 1.0;
105 image.normal: "tog_base_off.png";
107 description { state: "disabled" 0.0;
108 inherit: "default" 0.0;
109 image.normal: "tog_dis_base_off.png";
112 part { name: "elm.offtext";
117 description { state: "default" 0.0;
120 rel1.relative: 1.0 0.0;
121 rel2.to_x: "offrect";
124 font: "Sans,Edje-Vera";
131 description { state: "disabled" 0.0;
132 inherit: "default" 0.0;
133 color: 128 128 128 128;
136 part { name: "elm.ontext";
142 description { state: "default" 0.0;
148 rel2.relative: 0.0 1.0;
149 color: 224 224 224 255;
152 font: "Sans,Edje-Vera";
159 description { state: "disabled" 0.0;
160 inherit: "default" 0.0;
161 color: 128 128 128 128;
165 part { name: "conf_over";
167 description { state: "default" 0.0;
173 normal: "shelf_inset.png";
180 part { name: "button0";
183 description { state: "default" 0.0;
189 normal: "bt_bases.png";
193 color: 255 255 255 128;
196 part { name: "button2";
199 description { state: "default" 0.0;
205 normal: "bt_basew.png";
211 part { name: "button3";
214 description { state: "default" 0.0;
217 rel2.relative: 1.0 0.5;
219 normal: "bt_hilightw.png";
224 part { name: "elm.swallow.content";
226 description { state: "default" 0.0;
231 rel2.relative: 0.0 1.0;
234 description { state: "visible" 0.0;
235 inherit: "default" 0.0;
240 description { state: "disabled" 0.0;
241 inherit: "default" 0.0;
242 color: 128 128 128 128;
244 description { state: "disabled_visible" 0.0;
245 inherit: "default" 0.0;
246 color: 128 128 128 128;
251 part { name: "elm.text";
255 description { state: "default" 0.0;
257 rel1.to_x: "elm.swallow.content";
258 rel1.relative: 1.0 0.0;
261 rel2.relative: 0.0 1.0;
265 font: "Sans,Edje-Vera";
271 description { state: "visible" 0.0;
272 inherit: "default" 0.0;
276 description { state: "disabled" 0.0;
277 inherit: "default" 0.0;
278 color: 128 128 128 128;
280 description { state: "disabled_visible" 0.0;
281 inherit: "default" 0.0;
282 color: 128 128 128 128;
287 part { name: "disabler";
289 description { state: "default" 0.0;
293 description { state: "disabled" 0.0;
294 inherit: "default" 0.0;
300 program { name: "drag_end";
301 signal: "mouse,up,1";
304 new Float:dx, Float:dy;
305 get_drag(PART:"button", dx, dy);
308 set_drag(PART:"button", 1.0, 0.0);
312 set_drag(PART:"button", 0.0, 0.0);
314 if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
315 (get_int(is_rtl) == 0) && (dx > 0.5)) {
316 emit("elm,action,toggle,on", "");
319 emit("elm,action,toggle,off", "");
324 program { name: "toggle_on";
325 signal: "elm,state,toggle,on";
329 if (get_int(is_rtl) == 0) {
335 set_drag(PART:"button", drag, 0.0);
338 program { name: "toggle_off";
339 signal: "elm,state,toggle,off";
343 if (get_int(is_rtl) == 0) {
349 set_drag(PART:"button", drag, 0.0);
352 program { name: "text_show";
353 signal: "elm,state,text,visible";
355 action: STATE_SET "visible" 0.0;
358 program { name: "text_hide";
359 signal: "elm,state,text,hidden";
361 action: STATE_SET "default" 0.0;
364 program { name: "icon_show";
365 signal: "elm,state,icon,visible";
367 action: STATE_SET "visible" 0.0;
368 target: "elm.swallow.content";
370 program { name: "icon_hide";
371 signal: "elm,state,icon,hidden";
373 action: STATE_SET "default" 0.0;
374 target: "elm.swallow.content";
376 program { name: "disable";
377 signal: "elm,state,disabled";
379 action: STATE_SET "disabled" 0.0;
380 target: "elm.offtext";
381 target: "elm.ontext";
385 after: "disable_text";
387 program { name: "disable_text";
391 get_state(PART:"elm.text", st, 30, vl);
392 if (!strcmp(st, "visible"))
393 set_state(PART:"elm.text", "disabled_visible", 0.0);
395 set_state(PART:"elm.text", "disabled", 0.0);
397 get_state(PART:"elm.swallow.content", st, 30, vl);
398 if (!strcmp(st, "visible"))
399 set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
401 set_state(PART:"elm.swallow.content", "disabled", 0.0);
404 program { name: "enable";
405 signal: "elm,state,enabled";
407 action: STATE_SET "default" 0.0;
411 after: "enable_text";
413 program { name: "enable_text";
417 get_state(PART:"elm.text", st, 30, vl);
418 if (!strcmp(st, "disabled_visible"))
419 set_state(PART:"elm.text", "visible", 0.0);
421 set_state(PART:"elm.text", "default", 0.0);
423 get_state(PART:"elm.swallow.content", st, 30, vl);
424 if (!strcmp(st, "visible"))
425 set_state(PART:"elm.swallow.content", "visible", 0.0);
427 set_state(PART:"elm.swallow.content", "default", 0.0);
430 program { name: "to_rtl";
431 signal: "edje,state,rtl";
437 program { name: "to_ltr";
438 signal: "edje,state,ltr";