1 group { name: "elm/toggle/base/default";
3 image: "shelf_inset.png" COMP;
4 image: "bt_basew.png" COMP;
5 image: "bt_bases.png" COMP;
6 image: "bt_hilightw.png" COMP;
7 image: "tog_base_on.png" COMP;
8 image: "tog_base_off.png" COMP;
9 image: "tog_dis_base_on.png" COMP;
10 image: "tog_dis_base_off.png" COMP;
20 description { state: "default" 0.0;
21 rel1.relative: 1.0 0.0;
28 aspect_preference: VERTICAL;
29 color: 255 255 255 255;
32 part { name: "clipper";
35 description { state: "default" 0.0;
38 color: 255 255 255 255;
41 part { name: "button";
51 description { state: "default" 0.0;
58 aspect_preference: VERTICAL;
62 part { name: "button_events";
67 description { state: "default" 0.0;
70 rel1.relative: 0.0 0.0;
73 rel2.relative: 1.0 1.0;
77 part { name: "onrect";
82 description { state: "default" 0.0;
84 rel1.relative: -5.0 0.0;
86 rel2.relative: 0.5 1.0;
87 image.normal: "tog_base_on.png";
89 description { state: "disabled" 0.0;
90 inherit: "default" 0.0;
91 image.normal: "tog_dis_base_on.png";
94 part { name: "offrect";
99 description { state: "default" 0.0;
101 rel1.relative: 0.5 0.0;
103 rel2.relative: 6.0 1.0;
104 image.normal: "tog_base_off.png";
106 description { state: "disabled" 0.0;
107 inherit: "default" 0.0;
108 image.normal: "tog_dis_base_off.png";
111 part { name: "elm.offtext";
116 description { state: "default" 0.0;
119 rel1.relative: 1.0 0.0;
120 rel2.to_x: "offrect";
123 font: "Sans,Edje-Vera";
130 description { state: "disabled" 0.0;
131 inherit: "default" 0.0;
132 color: 128 128 128 128;
135 part { name: "elm.ontext";
141 description { state: "default" 0.0;
147 rel2.relative: 0.0 1.0;
148 color: 224 224 224 255;
151 font: "Sans,Edje-Vera";
158 description { state: "disabled" 0.0;
159 inherit: "default" 0.0;
160 color: 128 128 128 128;
164 part { name: "conf_over";
166 description { state: "default" 0.0;
172 normal: "shelf_inset.png";
179 part { name: "button0";
182 description { state: "default" 0.0;
188 normal: "bt_bases.png";
192 color: 255 255 255 128;
195 part { name: "button2";
198 description { state: "default" 0.0;
204 normal: "bt_basew.png";
210 part { name: "button3";
213 description { state: "default" 0.0;
216 rel2.relative: 1.0 0.5;
218 normal: "bt_hilightw.png";
223 part { name: "elm.swallow.content";
225 description { state: "default" 0.0;
230 rel2.relative: 0.0 1.0;
233 description { state: "visible" 0.0;
234 inherit: "default" 0.0;
239 description { state: "disabled" 0.0;
240 inherit: "default" 0.0;
241 color: 128 128 128 128;
243 description { state: "disabled_visible" 0.0;
244 inherit: "default" 0.0;
245 color: 128 128 128 128;
250 part { name: "elm.text";
254 description { state: "default" 0.0;
256 rel1.to_x: "elm.swallow.content";
257 rel1.relative: 1.0 0.0;
260 rel2.relative: 0.0 1.0;
264 font: "Sans,Edje-Vera";
270 description { state: "visible" 0.0;
271 inherit: "default" 0.0;
275 description { state: "disabled" 0.0;
276 inherit: "default" 0.0;
277 color: 128 128 128 128;
279 description { state: "disabled_visible" 0.0;
280 inherit: "default" 0.0;
281 color: 128 128 128 128;
286 part { name: "disabler";
288 description { state: "default" 0.0;
292 description { state: "disabled" 0.0;
293 inherit: "default" 0.0;
299 program { name: "drag_end";
300 signal: "mouse,up,1";
303 new Float:dx, Float:dy;
304 get_drag(PART:"button", dx, dy);
307 set_drag(PART:"button", 1.0, 0.0);
311 set_drag(PART:"button", 0.0, 0.0);
313 if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
314 (get_int(is_rtl) == 0) && (dx > 0.5)) {
315 emit("elm,action,toggle,on", "");
318 emit("elm,action,toggle,off", "");
323 program { name: "toggle_on";
324 signal: "elm,state,toggle,on";
328 if (get_int(is_rtl) == 0) {
334 set_drag(PART:"button", drag, 0.0);
337 program { name: "toggle_off";
338 signal: "elm,state,toggle,off";
342 if (get_int(is_rtl) == 0) {
348 set_drag(PART:"button", drag, 0.0);
351 program { name: "text_show";
352 signal: "elm,state,text,visible";
354 action: STATE_SET "visible" 0.0;
357 program { name: "text_hide";
358 signal: "elm,state,text,hidden";
360 action: STATE_SET "default" 0.0;
363 program { name: "icon_show";
364 signal: "elm,state,icon,visible";
366 action: STATE_SET "visible" 0.0;
367 target: "elm.swallow.content";
369 program { name: "icon_hide";
370 signal: "elm,state,icon,hidden";
372 action: STATE_SET "default" 0.0;
373 target: "elm.swallow.content";
375 program { name: "disable";
376 signal: "elm,state,disabled";
378 action: STATE_SET "disabled" 0.0;
379 target: "elm.offtext";
380 target: "elm.ontext";
384 after: "disable_text";
386 program { name: "disable_text";
390 get_state(PART:"elm.text", st, 30, vl);
391 if (!strcmp(st, "visible"))
392 set_state(PART:"elm.text", "disabled_visible", 0.0);
394 set_state(PART:"elm.text", "disabled", 0.0);
396 get_state(PART:"elm.swallow.content", st, 30, vl);
397 if (!strcmp(st, "visible"))
398 set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
400 set_state(PART:"elm.swallow.content", "disabled", 0.0);
403 program { name: "enable";
404 signal: "elm,state,enabled";
406 action: STATE_SET "default" 0.0;
410 after: "enable_text";
412 program { name: "enable_text";
416 get_state(PART:"elm.text", st, 30, vl);
417 if (!strcmp(st, "disabled_visible"))
418 set_state(PART:"elm.text", "visible", 0.0);
420 set_state(PART:"elm.text", "default", 0.0);
422 get_state(PART:"elm.swallow.content", st, 30, vl);
423 if (!strcmp(st, "visible"))
424 set_state(PART:"elm.swallow.content", "visible", 0.0);
426 set_state(PART:"elm.swallow.content", "default", 0.0);
429 program { name: "to_rtl";
430 signal: "edje,state,rtl";
436 program { name: "to_ltr";
437 signal: "edje,state,ltr";