summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYeongJong Lee <yj34.lee@samsung.com>2018-02-26 20:28:37 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2018-02-26 20:28:56 +0900
commit736de05ea7fde749f0b6f356cb6a2b3acd8e3586 (patch)
tree5aadf44f57c3fac0c5336cfb63f08c3e5727cc8a
parentae51034b8519f90ab871315f63171ca34fba5288 (diff)
efl.ui.check: change signal name for icon/text
Summary: see also 73f8b3b78f0ff92ddfc1c16426bf7c176f10293a Test Plan: 1. elementary_test -to check 2. check that icon is visible Reviewers: cedric, woohyun, Jaehyun_Cho Reviewed By: Jaehyun_Cho Differential Revision: https://phab.enlightenment.org/D5816
-rw-r--r--data/elementary/themes/edc/efl/check.edc934
-rw-r--r--src/Makefile_Elementary.am1
-rw-r--r--src/lib/elementary/efl_ui_check.c123
-rw-r--r--src/lib/elementary/efl_ui_check.eo1
-rw-r--r--src/lib/elementary/efl_ui_check_legacy.eo3
-rw-r--r--src/lib/elementary/efl_ui_check_legacy_part.eo8
6 files changed, 1027 insertions, 43 deletions
diff --git a/data/elementary/themes/edc/efl/check.edc b/data/elementary/themes/edc/efl/check.edc
index 76db7a8d28..6bcc5cfa78 100644
--- a/data/elementary/themes/edc/efl/check.edc
+++ b/data/elementary/themes/edc/efl/check.edc
@@ -1,7 +1,937 @@
1group { "efl/check"; 1group { "efl/check";
2 inherit: "elm/check/base/default"; 2 images.image: "inset_shadow_tiny.png" COMP;
3 images.image: "bevel_in.png" COMP;
4 images.image: "sym_check_alum.png" COMP;
5#define ICON 1
6#define LABEL 2
7#define MASK 3
8#define DISABLE 4
9 script {
10 public btmode;
11 public eval_mode(m) {
12 new m1 = m & MASK;
13 new d = m & DISABLE;
14 if (m1 == (ICON | LABEL)) {
15 if (!d) {
16 set_state(PART:"elm.swallow.content", "visible", 0.0);
17 set_state(PART:"sizer.content", "visible", 0.0);
18 set_state(PART:"elm.text", "visible", 0.0);
19 set_state(PART:"shadow", "default", 0.0);
20 set_state(PART:"base", "default", 0.0);
21 set_state(PART:"clip", "default", 0.0);
22 set_state(PART:"event", "default", 0.0);
23 } else {
24 set_state(PART:"elm.swallow.content", "visible", 0.0);
25 set_state(PART:"sizer.content", "visible", 0.0);
26 set_state(PART:"elm.text", "disabled_visible", 0.0);
27 set_state(PART:"shadow", "disabled", 0.0);
28 set_state(PART:"base", "disabled", 0.0);
29 set_state(PART:"clip", "disabled", 0.0);
30 set_state(PART:"event", "disabled", 0.0);
31 }
32 } else if (m1 == (ICON)) {
33 if (!d) {
34 set_state(PART:"elm.swallow.content", "visible", 0.0);
35 set_state(PART:"sizer.content", "icononly", 0.0);
36 set_state(PART:"elm.text", "default", 0.0);
37 set_state(PART:"shadow", "default", 0.0);
38 set_state(PART:"base", "default", 0.0);
39 set_state(PART:"clip", "default", 0.0);
40 set_state(PART:"event", "default", 0.0);
41 } else {
42 set_state(PART:"elm.swallow.content", "visible", 0.0);
43 set_state(PART:"sizer.content", "icononly", 0.0);
44 set_state(PART:"elm.text", "disabled", 0.0);
45 set_state(PART:"shadow", "disabled", 0.0);
46 set_state(PART:"base", "disabled", 0.0);
47 set_state(PART:"clip", "disabled", 0.0);
48 set_state(PART:"event", "disabled", 0.0);
49 }
50 } else if (m1 == (LABEL)) {
51 if (!d) {
52 set_state(PART:"elm.swallow.content", "default", 0.0);
53 set_state(PART:"sizer.content", "default", 0.0);
54 set_state(PART:"elm.text", "visible", 0.0);
55 set_state(PART:"shadow", "default", 0.0);
56 set_state(PART:"base", "default", 0.0);
57 set_state(PART:"clip", "default", 0.0);
58 set_state(PART:"event", "default", 0.0);
59 } else {
60 set_state(PART:"elm.swallow.content", "default", 0.0);
61 set_state(PART:"sizer.content", "default", 0.0);
62 set_state(PART:"elm.text", "disabled_visible", 0.0);
63 set_state(PART:"shadow", "disabled", 0.0);
64 set_state(PART:"base", "disabled", 0.0);
65 set_state(PART:"clip", "disabled", 0.0);
66 set_state(PART:"event", "disabled", 0.0);
67 }
68 } else {
69 if (!d) {
70 set_state(PART:"elm.swallow.content", "default", 0.0);
71 set_state(PART:"sizer.content", "default", 0.0);
72 set_state(PART:"elm.text", "default", 0.0);
73 set_state(PART:"shadow", "default", 0.0);
74 set_state(PART:"base", "default", 0.0);
75 set_state(PART:"clip", "default", 0.0);
76 set_state(PART:"event", "default", 0.0);
77 } else {
78 set_state(PART:"elm.swallow.content", "default", 0.0);
79 set_state(PART:"sizer.content", "default", 0.0);
80 set_state(PART:"elm.text", "default", 0.0);
81 set_state(PART:"shadow", "disabled", 0.0);
82 set_state(PART:"base", "disabled", 0.0);
83 set_state(PART:"clip", "disabled", 0.0);
84 set_state(PART:"event", "disabled", 0.0);
85 }
86 }
87 }
88 }
89 parts {
90 part { name: "base"; type: RECT;
91 description { state: "default" 0.0;
92 rel1.offset: 1 1;
93 rel1.to: "inset";
94 rel2.offset: -2 -2;
95 rel2.to: "inset";
96 color: 24 24 24 255;
97 }
98 description { state: "disabled" 0.0;
99 inherit: "default" 0.0;
100 color: 64 64 64 255;
101 }
102 }
103 part { name: "shadow"; mouse_events: 0;
104 description { state: "default" 0.0;
105 image.normal: "inset_shadow_tiny.png";
106 image.border: 4 4 4 4;
107 rel1.to: "base";
108 rel2.to: "base";
109 }
110 description { state: "disabled" 0.0;
111 inherit: "default" 0.0;
112 visible: 0;
113 }
114 }
115 part { name: "inset"; mouse_events: 0;
116 scale: 1;
117 description { state: "default" 0.0;
118 fixed: 1 0;
119 rel1.offset: 2 2;
120 rel2.relative: 0.0 1.0;
121 rel2.offset: 2 -3;
122 align: 0.0 0.5;
123 min: 13 13;
124 max: 13 13;
125 image.normal: "bevel_in.png";
126 image.border: 1 1 1 1;
127 image.middle: 0;
128 fill.smooth: 0;
129 }
130 }
131 part { name: "indicator"; mouse_events: 0;
132 scale: 1;
133 clip_to: "clip";
134 description { state: "default" 0.0;
135 fixed: 1 1;
136 rel1.to: "base";
137 rel2.to: "base";
138 image.normal: "sym_check_alum.png";
139 min: 11 11;
140 max: 11 11;
141 visible: 0;
142 }
143 description { state: "selected" 0.0;
144 inherit: "default" 0.0;
145 visible: 1;
146 }
147 }
148 part { name: "clip"; type: RECT;
149 description { state: "default" 0.0;
150 }
151 description { state: "disabled" 0.0;
152 inherit: "default" 0.0;
153 color: 255 255 255 64;
154 }
155 }
156 part { name: "elm.swallow.content"; type: SWALLOW;
157 scale: 1;
158 clip_to: "clip";
159 required;
160 description { state: "default" 0.0;
161 fixed: 1 0;
162 visible: 0;
163 align: 0.0 0.5;
164 max: 0 0;
165 rel1.to_x: "inset";
166 rel1.relative: 1.0 0.0;
167 rel1.offset: 1 1;
168 rel2.to_x: "inset";
169 rel2.offset: 1 -2;
170 rel2.relative: 1.0 1.0;
171 }
172 description { state: "visible" 0.0;
173 inherit: "default" 0.0;
174 visible: 1;
175 aspect: 1.0 1.0;
176 min: 16 16;
177 }
178 }
179 part { name: "sizer.content"; type: TEXT; mouse_events: 0;
180 scale: 1;
181 description { state: "default" 0.0;
182 fixed: 1 1;
183 visible: 0;
184 text { font: FN; size: 10;
185 min: 0 0;
186 text_class: "check_text";
187 }
188 }
189 description { state: "visible" 0.0;
190 inherit: "default" 0.0;
191 rel1.to: "elm.swallow.content";
192 rel2.to: "elm.swallow.content";
193 text {
194 min: 1 1;
195 ellipsis: -1;
196 text: "M";
197 }
198 }
199 description { state: "icononly" 0.0;
200 inherit: "default" 0.0;
201 rel1.to: "elm.swallow.content";
202 rel2.to: "elm.swallow.content";
203 text {
204 min: 1 1;
205 ellipsis: -1;
206 text: "M";
207 }
208 }
209 }
210 part { name: "elm.text"; type: TEXT; mouse_events: 0;
211 effect: SHADOW BOTTOM;
212 scale: 1;
213 required;
214 description { state: "default" 0.0;
215 rel1.offset: 2 2;
216 rel1.to_x: "elm.swallow.content";
217 rel1.relative: 1.0 0.0;
218 rel2.offset: -3 -3;
219 color: FN_COL_DEFAULT;
220 color_class: "check_text";
221 text { font: FN; size: 10;
222 min: 0 0;
223 align: 0.0 0.5;
224 text_class: "check";
225 }
226 }
227 description { state: "disabled" 0.0;
228 inherit: "default" 0.0;
229 color_class: "check_text_disabled";
230 color3: 255 255 255 255;
231 }
232 description { state: "visible" 0.0;
233 inherit: "default" 0.0;
234 visible: 1;
235 text.min: 1 1;
236 text.ellipsis: -1;
237 }
238 description { state: "disabled_visible" 0.0;
239 inherit: "default" 0.0;
240 color_class: "check_text_disabled";
241 color3: 255 255 255 255;
242 visible: 1;
243 text.min: 1 1;
244 text.ellipsis: -1;
245 }
246 }
247 part { name: "event"; type: RECT;
248 ignore_flags: ON_HOLD;
249 description { state: "default" 0.0;
250 color: 0 0 0 0;
251 }
252 description { state: "disabled" 0.0;
253 inherit: "default" 0.0;
254 visible: 0;
255 }
256 }
257 }
258 programs {
259 program {
260 signal: "mouse,clicked,1"; source: "event";
261 action: SIGNAL_EMIT "elm,action,check,toggle" "elm";
262 }
263 program {
264 signal: "elm,state,check,on"; source: "elm";
265 action: STATE_SET "selected" 0.0;
266 target: "indicator";
267 }
268 program {
269 signal: "elm,state,check,off"; source: "elm";
270 action: STATE_SET "default" 0.0;
271 target: "indicator";
272 }
273 program {
274 signal: "elm,state,elm.text,set"; source: "elm";
275 script {
276 new m = get_int(btmode);
277 m |= LABEL; set_int(btmode, m);
278 eval_mode(m);
279 }
280 }
281 program {
282 signal: "elm,state,elm.text,unset"; source: "elm";
283 script {
284 new m = get_int(btmode);
285 m &= ~LABEL; set_int(btmode, m);
286 eval_mode(m);
287 }
288 }
289 program {
290 signal: "elm,state,content,set"; source: "elm";
291 script {
292 new m = get_int(btmode);
293 m |= ICON; set_int(btmode, m);
294 eval_mode(m);
295 }
296 }
297 program {
298 signal: "elm,state,content,unset"; source: "elm";
299 script {
300 new m = get_int(btmode);
301 m &= ~ICON; set_int(btmode, m);
302 eval_mode(m);
303 }
304 }
305 program {
306 signal: "elm,state,disabled"; source: "elm";
307 script {
308 new m = get_int(btmode);
309 m |= DISABLE; set_int(btmode, m);
310 eval_mode(m);
311 }
312 }
313 program {
314 signal: "elm,state,enabled"; source: "elm";
315 script {
316 new m = get_int(btmode);
317 m &= ~DISABLE; set_int(btmode, m);
318 eval_mode(m);
319 }
320 }
321 }
322#undef ICON
323#undef LABEL
324#undef MASK
325#undef DISABLE
3} 326}
4 327
5group { "efl/check:toggle"; 328group { "efl/check:toggle";
6 inherit: "elm/check/base/toggle"; 329 images.image: "inset_shadow_tiny.png" COMP;
330 images.image: "bevel_in.png" COMP;
331 images.image: "bevel_out.png" COMP;
332 images.image: "vgrad_med_lighter.png" COMP;
333 images.image: "shadow_square_tiny.png" COMP;
334 images.image: "glow_small.png" COMP;
335
336#define ICON 1
337#define LABEL 2
338#define MASK 3
339#define DISABLE 4
340 script {
341 public is_rtl;
342 public is_drag;
343 public was_drag;
344 public btmode;
345 public eval_mode(m) {
346 new m1 = m & MASK;
347 new d = m & DISABLE;
348 if (m1 == (ICON | LABEL)) {
349 if (!d) {
350 set_state(PART:"elm.swallow.content", "visible", 0.0);
351 set_state(PART:"sizer.content", "visible", 0.0);
352 set_state(PART:"elm.text", "visible", 0.0);
353 set_state(PART:"shadow", "default", 0.0);
354 set_state(PART:"clip", "default", 0.0);
355 set_state(PART:"event", "default", 0.0);
356 set_state(PART:"event2", "default", 0.0);
357 set_state(PART:"elm.ontext", "default", 0.0);
358 set_state(PART:"elm.offtext", "default", 0.0);
359 set_state(PART:"onrect", "default", 0.0);
360 set_state(PART:"offrect", "default", 0.0);
361 } else {
362 set_state(PART:"elm.swallow.content", "visible", 0.0);
363 set_state(PART:"sizer.content", "visible", 0.0);
364 set_state(PART:"elm.text", "disabled_visible", 0.0);
365 set_state(PART:"shadow", "disabled", 0.0);
366 set_state(PART:"clip", "disabled", 0.0);
367 set_state(PART:"event", "disabled", 0.0);
368 set_state(PART:"event2", "disabled", 0.0);
369 set_state(PART:"elm.ontext", "disabled", 0.0);
370 set_state(PART:"elm.offtext", "disabled", 0.0);
371 set_state(PART:"onrect", "disabled", 0.0);
372 set_state(PART:"offrect", "disabled", 0.0);
373 }
374 } else if (m1 == (ICON)) {
375 if (!d) {
376 set_state(PART:"elm.swallow.content", "visible", 0.0);
377 set_state(PART:"sizer.content", "icononly", 0.0);
378 set_state(PART:"elm.text", "default", 0.0);
379 set_state(PART:"shadow", "default", 0.0);
380 set_state(PART:"clip", "default", 0.0);
381 set_state(PART:"event", "default", 0.0);
382 set_state(PART:"event2", "default", 0.0);
383 set_state(PART:"elm.ontext", "default", 0.0);
384 set_state(PART:"elm.offtext", "default", 0.0);
385 set_state(PART:"onrect", "default", 0.0);
386 set_state(PART:"offrect", "default", 0.0);
387 } else {
388 set_state(PART:"elm.swallow.content", "visible", 0.0);
389 set_state(PART:"sizer.content", "icononly", 0.0);
390 set_state(PART:"elm.text", "disabled", 0.0);
391 set_state(PART:"shadow", "disabled", 0.0);
392 set_state(PART:"clip", "disabled", 0.0);
393 set_state(PART:"event", "disabled", 0.0);
394 set_state(PART:"event2", "disabled", 0.0);
395 set_state(PART:"elm.ontext", "disabled", 0.0);
396 set_state(PART:"elm.offtext", "disabled", 0.0);
397 set_state(PART:"onrect", "disabled", 0.0);
398 set_state(PART:"offrect", "disabled", 0.0);
399 }
400 } else if (m1 == (LABEL)) {
401 if (!d) {
402 set_state(PART:"elm.swallow.content", "default", 0.0);
403 set_state(PART:"sizer.content", "default", 0.0);
404 set_state(PART:"elm.text", "visible", 0.0);
405 set_state(PART:"shadow", "default", 0.0);
406 set_state(PART:"clip", "default", 0.0);
407 set_state(PART:"event", "default", 0.0);
408 set_state(PART:"event2", "default", 0.0);
409 set_state(PART:"elm.ontext", "default", 0.0);
410 set_state(PART:"elm.offtext", "default", 0.0);
411 set_state(PART:"onrect", "default", 0.0);
412 set_state(PART:"offrect", "default", 0.0);
413 } else {
414 set_state(PART:"elm.swallow.content", "default", 0.0);
415 set_state(PART:"sizer.content", "default", 0.0);
416 set_state(PART:"elm.text", "disabled_visible", 0.0);
417 set_state(PART:"shadow", "disabled", 0.0);
418 set_state(PART:"clip", "disabled", 0.0);
419 set_state(PART:"event", "disabled", 0.0);
420 set_state(PART:"event2", "disabled", 0.0);
421 set_state(PART:"elm.ontext", "disabled", 0.0);
422 set_state(PART:"elm.offtext", "disabled", 0.0);
423 set_state(PART:"onrect", "disabled", 0.0);
424 set_state(PART:"offrect", "disabled", 0.0);
425 }
426 } else {
427 if (!d) {
428 set_state(PART:"elm.swallow.content", "default", 0.0);
429 set_state(PART:"sizer.content", "default", 0.0);
430 set_state(PART:"elm.text", "default", 0.0);
431 set_state(PART:"shadow", "default", 0.0);
432 set_state(PART:"clip", "default", 0.0);
433 set_state(PART:"event", "default", 0.0);
434 set_state(PART:"event2", "default", 0.0);
435 set_state(PART:"elm.ontext", "default", 0.0);
436 set_state(PART:"elm.offtext", "default", 0.0);
437 set_state(PART:"onrect", "default", 0.0);
438 set_state(PART:"offrect", "default", 0.0);
439 } else {
440 set_state(PART:"elm.swallow.content", "default", 0.0);
441 set_state(PART:"sizer.content", "default", 0.0);
442 set_state(PART:"elm.text", "default", 0.0);
443 set_state(PART:"shadow", "disabled", 0.0);
444 set_state(PART:"clip", "disabled", 0.0);
445 set_state(PART:"event", "disabled", 0.0);
446 set_state(PART:"event2", "disabled", 0.0);
447 set_state(PART:"elm.ontext", "disabled", 0.0);
448 set_state(PART:"elm.offtext", "disabled", 0.0);
449 set_state(PART:"onrect", "disabled", 0.0);
450 set_state(PART:"offrect", "disabled", 0.0);
451 }
452 }
453 }
454 }
455 parts {
456 part { name: "tog"; type: SPACER;
457 scale: 1;
458 description { state: "default" 0.0;
459 fixed: 1 0;
460 rel1.relative: 1.0 0.0;
461 rel1.offset: 2 2;
462 rel2.offset: -3 -3;
463 align: 1.0 0.5;
464 min: 88 15;
465 max: 88 15;
466 }
467 }
468 part { name: "onrect"; type: RECT; mouse_events: 0;
469 scale: 1;
470 clip_to: "tog_clip";
471 description { state: "default" 0.0;
472 rel1.to: "button";
473 rel1.relative: -5.0 0.0;
474 rel2.to: "button";
475 rel2.relative: 0.5 1.0;
476 color: 24 24 24 255;
477 }
478 description { state: "disabled" 0.0;
479 inherit: "default" 0.0;
480 color: 64 64 64 255;
481 }
482 }
483 part { name: "offrect"; type: RECT; mouse_events: 0;
484 scale: 1;
485 clip_to: "tog_clip";
486 description { state: "default" 0.0;
487 rel1.to: "button";
488 rel1.relative: 0.5 0.0;
489 rel2.to: "button";
490 rel2.relative: 6.0 1.0;
491 color: 24 24 24 255;
492 }
493 description { state: "disabled" 0.0;
494 inherit: "default" 0.0;
495 color: 64 64 64 255;
496 }
497 }
498 part { name: "elm.offtext"; type: TEXT; mouse_events: 0;
499 effect: SHADOW BOTTOM;
500 scale: 1;
501 clip_to: "tog_clip";
502 description { state: "default" 0.0;
503 fixed: 1 1;
504 rel1.to: "button";
505 rel1.relative: 1.0 0.0;
506 rel2.to: "offrect";
507 color: FN_COL_DEFAULT;
508 color_class: "check_off_text";
509 text { font: FN; size: 10;
510 min: 0 1;
511 align: 0.5 0.5;
512 text_class: "check_off_text";
513 text: "OFF";
514 }
515 }
516 description { state: "disabled" 0.0;
517 inherit: "default" 0.0;
518 color_class: "check_off_text_disabled";
519 color3: 255 255 255 255;
520 }
521 }
522 part { name: "elm.ontext"; type: TEXT; mouse_events: 0;
523 effect: GLOW;
524 scale: 1;
525 clip_to: "tog_clip";
526 description { state: "default" 0.0;
527 fixed: 1 1;
528 rel1.to: "onrect";
529 rel1.offset: 2 -1;
530 rel2.to: "button";
531 rel2.relative: 0.0 1.0;
532 rel2.offset: -1 -2;
533 color_class: "check_on_text";
534 color2: 255 255 255 255;
535 color3: 255 255 255 255;
536 text { font: FN; size: 10;
537 min: 0 1;
538 align: 0.5 0.5;
539 text_class: "check_on_text";
540 text: "ON";
541 }
542 }
543 description { state: "disabled" 0.0;
544 inherit: "default" 0.0;
545 color_class: "check_on_text_disabled";
546 color3: 255 255 255 255;
547 }
548 }
549 part { name: "shadow"; mouse_events: 0;
550 description { state: "default" 0.0;
551 image.normal: "inset_shadow_tiny.png";
552 image.border: 4 4 4 4;
553 rel1.to: "tog";
554 rel2.to: "tog";
555 }
556 description { state: "disabled" 0.0;
557 inherit: "default" 0.0;
558 visible: 0;
559 }
560 }
561 part { name: "inset"; mouse_events: 0;
562 scale: 1;
563 description { state: "default" 0.0;
564 fixed: 1 1;
565 rel1.to: "tog";
566 rel1.offset: -1 -1;
567 rel2.to: "tog";
568 rel2.offset: 0 0;
569 image.normal: "bevel_in.png";
570 image.border: 1 1 1 1;
571 image.middle: 0;
572 fill.smooth: 0;
573 }
574 }
575 part { name: "tog_clip"; type: RECT;
576 description { state: "default" 0.0;
577 rel1.to: "tog";
578 rel2.to: "tog";
579 }
580 }
581 part { name: "button"; type: RECT;
582 scale: 1;
583 clip_to: "tog_clip";
584 dragable {
585 x: 1 1 0;
586 y: 0 0 0;
587 confine: "tog";
588 }
589 description { state: "default" 0.0;
590 fixed: 1 1;
591 rel1.to: "tog";
592 rel2.to: "tog";
593 min: 15 15;
594 max: 15 99999;
595 color: 0 0 0 0;
596 }
597 }
598 part { name: "shadow_but"; mouse_events: 0;
599 description { state: "default" 0.0;
600 rel1.offset: -3 -2;
601 rel1.to: "base_but";
602 rel2.offset: 2 4;
603 rel2.to: "base_but";
604 image.normal: "shadow_square_tiny.png";
605 image.border: 6 6 6 6;
606 fill.smooth: 0;
607 }
608 description { state: "clicked" 0.0;
609 inherit: "default" 0.0;
610 rel1.offset: -2 -2;
611 rel2.offset: 1 1;
612 color: 255 255 255 128;
613 }
614 }
615 part { name: "glow_but"; mouse_events: 0;
616 description { state: "default" 0.0;
617 rel1.offset: -3 -3;
618 rel1.to: "base_but";
619 rel2.offset: 2 2;
620 rel2.to: "base_but";
621 image.normal: "glow_small.png";
622 image.border: 7 7 7 7;
623 fill.smooth: 0;
624 visible: 0;
625 }
626 description { state: "clicked" 0.0;
627 inherit: "default" 0.0;
628 visible: 1;
629 }
630 }
631 part { name: "base_but"; mouse_events: 0;
632 description { state: "default" 0.0;
633 rel1.to: "button";
634 rel2.to: "button";
635 image.normal: "vgrad_med_lighter.png";
636 fill.smooth: 0;
637 TILED_HORIZ(120)
638 }
639 }
640 part { name: "bevel_but"; mouse_events: 0;
641 description { state: "default" 0.0;
642 rel1.to: "base_but";
643 rel2.to: "base_but";
644 image.normal: "bevel_out.png";
645 image.border: 1 1 1 1;
646 image.middle: 0;
647 fill.smooth: 0;
648 }
649 }
650 part { name: "button_events"; type: RECT;
651 dragable.events: "button";
652 description { state: "default" 0.0;
653 color: 0 0 0 0;
654 }
655 }
656 part { name: "clip"; type: RECT;
657 description { state: "default" 0.0;
658 }
659 description { state: "disabled" 0.0;
660 inherit: "default" 0.0;
661 color: 255 255 255 64;
662 }
663 }
664 part { name: "elm.swallow.content"; type: SWALLOW;
665 scale: 1;
666 clip_to: "clip";
667 description { state: "default" 0.0;
668 fixed: 1 0;
669 visible: 0;
670 align: 0.0 0.5;
671 max: 0 0;
672 rel1.offset: 1 1;
673 rel2.offset: 1 -2;
674 rel2.relative: 0.0 1.0;
675 }
676 description { state: "visible" 0.0;
677 inherit: "default" 0.0;
678 fixed: 0 0;
679 visible: 1;
680 min: 16 16;
681 }
682 }
683 part { name: "sizer.content"; type: TEXT; mouse_events: 0;
684 scale: 1;
685 description { state: "default" 0.0;
686 fixed: 1 1;
687 visible: 0;
688 text { font: FN; size: 10;
689 min: 0 0;
690 text_class: "check_text";
691 }
692 }
693 description { state: "visible" 0.0;
694 inherit: "default" 0.0;
695 rel1.to: "elm.swallow.content";
696 rel2.to: "elm.swallow.content";
697 text {
698 min: 1 1;
699 ellipsis: -1;
700 text: "M";
701 }
702 }
703 description { state: "icononly" 0.0;
704 inherit: "default" 0.0;
705 rel1.to: "elm.swallow.content";
706 rel2.to: "elm.swallow.content";
707 text {
708 min: 1 1;
709 ellipsis: -1;
710 text: "M";
711 }
712 }
713 }
714 part { name: "elm.text"; type: TEXT; mouse_events: 0;
715 effect: SHADOW BOTTOM;
716 scale: 1;
717 description { state: "default" 0.0;
718 rel1.to_x: "elm.swallow.content";
719 rel1.relative: 1.0 0.0;
720 rel1.offset: 2 2;
721 rel2.to_x: "tog";
722 rel2.relative: 0.0 1.0;
723 rel2.offset: -5 -3;
724 color: FN_COL_DEFAULT;
725 color_class: "check_text";
726 text { font: FN; size: 10;
727 min: 0 0;
728 align: 0.0 0.5;
729 text_class: "check";
730 }
731 }
732 description { state: "disabled" 0.0;
733 inherit: "default" 0.0;
734 color_class: "check_text_disabled";
735 color3: 255 255 255 255;
736 }
737 description { state: "visible" 0.0;
738 inherit: "default" 0.0;
739 visible: 1;
740 text.min: 1 1;
741 text.ellipsis: -1;
742 }
743 description { state: "disabled_visible" 0.0;
744 inherit: "default" 0.0;
745 color_class: "check_text_disabled";
746 color3: 255 255 255 255;
747 visible: 1;
748 text.min: 1 1;
749 text.ellipsis: -1;
750 }
751 }
752 part { name: "event"; type: RECT;
753 ignore_flags: ON_HOLD;
754 description { state: "default" 0.0;
755 color: 0 0 0 0;
756 rel1.to_x: "elm.swallow.content";
757 rel2.to_x: "elm.text";
758 }
759 description { state: "disabled" 0.0;
760 inherit: "default" 0.0;
761 visible: 0;
762 }
763 }
764 part { name: "event2"; type: RECT;
765 ignore_flags: ON_HOLD;
766 description { state: "default" 0.0;
767 color: 0 0 0 0;
768 visible: 0;
769 }
770 description { state: "disabled" 0.0;
771 inherit: "default" 0.0;
772 visible: 1;
773 }
774 }
775 }
776 programs {
777 program {
778 signal: "mouse,clicked,1"; source: "event";
779 action: SIGNAL_EMIT "elm,action,check,toggle" "elm";
780 }
781 program {
782 signal: "elm,state,check,on"; source: "elm";
783 script {
784 new Float:drag;
785 if (get_int(is_rtl) == 0) {
786 drag = 100.0;
787 } else {
788 drag = 0.0;
789 }
790 set_drag(PART:"button", drag, 0.0);
791 }
792 }
793 program {
794 signal: "elm,state,check,off"; source: "elm";
795 script {
796 new Float:drag;
797 if (get_int(is_rtl) == 0) {
798 drag = 0.0;
799 } else {
800 drag = 100.0;
801 }
802 set_drag(PART:"button", drag, 0.0);
803 }
804 }
805 program {
806 signal: "mouse,clicked,1"; source: "button";
807 script {
808 new Float:dx, Float:dy;
809 get_drag(PART:"button", dx, dy);
810 if (!get_int(was_drag)) {
811 if (dx > 0.5) {
812 set_drag(PART:"button", 0.0, 0.0);
813 } else {
814 set_drag(PART:"button", 1.0, 0.0);
815 }
816 if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
817 (get_int(is_rtl) == 0) && (dx > 0.5)) {
818 emit("elm,action,check,off", "elm");
819 } else {
820 emit("elm,action,check,on", "elm");
821 }
822 }
823 }
824 }
825 program {
826 signal: "drag"; source: "button";
827 script {
828 set_int(is_drag, 1);
829 }
830 }
831 program {
832 signal: "mouse,down,1"; source: "button";
833 script {
834 set_int(was_drag, 0);
835 set_int(is_drag, 0);
836 }
837 }
838 program { name: "drag_end";
839 signal: "mouse,up,1"; source: "button";
840 script {
841 new Float:dx, Float:dy;
842 get_drag(PART:"button", dx, dy);
843 if (get_int(is_drag)) {
844 if (dx > 0.5) {
845 set_drag(PART:"button", 1.0, 0.0);
846 } else {
847 set_drag(PART:"button", 0.0, 0.0);
848 }
849 if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
850 (get_int(is_rtl) == 0) && (dx > 0.5)) {
851 emit("elm,action,check,on", "elm");
852 } else {
853 emit("elm,action,check,off", "elm");
854 }
855 set_int(was_drag, 1);
856 set_int(is_drag, 0);
857 }
858 }
859 }
860 program {
861 signal: "mouse,down,1"; source: "button";
862 action: STATE_SET "clicked" 0.0;
863 target: "shadow_but";
864 target: "glow_but";
865 }
866 program {
867 signal: "mouse,up,1"; source: "button";
868 action: STATE_SET "default" 0.0;
869 target: "shadow_but";
870 target: "glow_but";
871 }
872 program {
873 signal: "elm,state,elm.text,set"; source: "elm";
874 script {
875 new m = get_int(btmode);
876 m |= LABEL; set_int(btmode, m);
877 eval_mode(m);
878 }
879 }
880 program {
881 signal: "elm,state,elm.text,unset"; source: "elm";
882 script {
883 new m = get_int(btmode);
884 m &= ~LABEL; set_int(btmode, m);
885 eval_mode(m);
886 }
887 }
888 program {
889 signal: "elm,state,content,set"; source: "elm";
890 script {
891 new m = get_int(btmode);
892 m |= ICON; set_int(btmode, m);
893 eval_mode(m);
894 }
895 }
896 program {
897 signal: "elm,state,content,unset"; source: "elm";
898 script {
899 new m = get_int(btmode);
900 m &= ~ICON; set_int(btmode, m);
901 eval_mode(m);
902 }
903 }
904 program {
905 signal: "elm,state,disabled"; source: "elm";
906 script {
907 new m = get_int(btmode);
908 m |= DISABLE; set_int(btmode, m);
909 eval_mode(m);
910 }
911 }
912 program {
913 signal: "elm,state,enabled"; source: "elm";
914 script {
915 new m = get_int(btmode);
916 m &= ~DISABLE; set_int(btmode, m);
917 eval_mode(m);
918 }
919 }
920 program {
921 signal: "edje,state,rtl"; source: "edje";
922 script {
923 set_int(is_rtl, 1);
924 }
925 }
926 program {
927 signal: "edje,state,ltr"; source: "edje";
928 script {
929 set_int(is_rtl, 0);
930 }
931 }
932 }
933#undef ICON
934#undef LABEL
935#undef MASK
936#undef DISABLE
7} 937}
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index 8cdc38478b..27cab7b3ae 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -108,6 +108,7 @@ elm_public_eolian_files += \
108 lib/elementary/efl_ui_legacy.eo \ 108 lib/elementary/efl_ui_legacy.eo \
109 lib/elementary/efl_ui_button_legacy_part.eo \ 109 lib/elementary/efl_ui_button_legacy_part.eo \
110 lib/elementary/efl_ui_radio_legacy_part.eo \ 110 lib/elementary/efl_ui_radio_legacy_part.eo \
111 lib/elementary/efl_ui_check_legacy_part.eo \
111 lib/elementary/elm_spinner.eo \ 112 lib/elementary/elm_spinner.eo \
112 lib/elementary/elm_multibuttonentry_item.eo \ 113 lib/elementary/elm_multibuttonentry_item.eo \
113 lib/elementary/elm_interface_scrollable.eo \ 114 lib/elementary/elm_interface_scrollable.eo \
diff --git a/src/lib/elementary/efl_ui_check.c b/src/lib/elementary/efl_ui_check.c
index a4cce48c46..168ab6304e 100644
--- a/src/lib/elementary/efl_ui_check.c
+++ b/src/lib/elementary/efl_ui_check.c
@@ -12,6 +12,7 @@
12#include "efl_ui_nstate.eo.h" 12#include "efl_ui_nstate.eo.h"
13#include "efl_ui_check_private.h" 13#include "efl_ui_check_private.h"
14#include "efl_ui_nstate_private.h" 14#include "efl_ui_nstate_private.h"
15#include "elm_part_helper.h"
15 16
16#define MY_CLASS EFL_UI_CHECK_CLASS 17#define MY_CLASS EFL_UI_CHECK_CLASS
17#define MY_CLASS_PFX efl_ui_check 18#define MY_CLASS_PFX efl_ui_check
@@ -84,23 +85,6 @@ _activate(Evas_Object *obj)
84 efl_ui_nstate_value_get(obj)); 85 efl_ui_nstate_value_get(obj));
85} 86}
86 87
87/* FIXME: replicated from elm_layout just because check's icon spot
88 * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
89 * can changed the theme API */
90static void
91_icon_signal_emit(Evas_Object *obj)
92{
93 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
94 char buf[64];
95
96 if (!elm_widget_resize_object_get(obj)) return;
97 snprintf(buf, sizeof(buf), "elm,state,icon,%s",
98 elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
99
100 elm_layout_signal_emit(obj, buf, "elm");
101 edje_object_message_signal_process(wd->resize_obj);
102}
103
104EOLIAN static Efl_Access_State_Set 88EOLIAN static Efl_Access_State_Set
105_efl_ui_check_efl_access_state_set_get(Eo *obj, Efl_Ui_Check_Data *_pd EINA_UNUSED) 89_efl_ui_check_efl_access_state_set_get(Eo *obj, Efl_Ui_Check_Data *_pd EINA_UNUSED)
106{ 90{
@@ -114,24 +98,6 @@ _efl_ui_check_efl_access_state_set_get(Eo *obj, Efl_Ui_Check_Data *_pd EINA_UNUS
114 return states; 98 return states;
115} 99}
116 100
117/* FIXME: replicated from elm_layout just because check's icon spot
118 * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
119 * can changed the theme API */
120EOLIAN static Eina_Bool
121_efl_ui_check_efl_ui_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Check_Data *_pd EINA_UNUSED, Evas_Object *sobj)
122{
123 Eina_Bool int_ret = EINA_FALSE;
124
125 int_ret = elm_widget_sub_object_del(efl_super(obj, MY_CLASS), sobj);
126 if (!int_ret) return EINA_FALSE;
127
128 _icon_signal_emit(obj);
129
130 elm_layout_sizing_eval(obj);
131
132 return EINA_TRUE;
133}
134
135EOLIAN static Eina_Bool 101EOLIAN static Eina_Bool
136_efl_ui_check_efl_ui_widget_on_access_activate(Eo *obj EINA_UNUSED, Efl_Ui_Check_Data *_pd EINA_UNUSED, Efl_Ui_Activate act) 102_efl_ui_check_efl_ui_widget_on_access_activate(Eo *obj EINA_UNUSED, Efl_Ui_Check_Data *_pd EINA_UNUSED, Efl_Ui_Activate act)
137{ 103{
@@ -168,11 +134,6 @@ _efl_ui_check_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Check_Data *sd EINA_UNUS
168 134
169 edje_object_message_signal_process(wd->resize_obj); 135 edje_object_message_signal_process(wd->resize_obj);
170 136
171 /* FIXME: replicated from elm_layout just because check's icon spot
172 * is elm.swallow.content, not elm.swallow.icon. Fix that whenever
173 * we can changed the theme API */
174 _icon_signal_emit(obj);
175
176 elm_layout_sizing_eval(obj); 137 elm_layout_sizing_eval(obj);
177 138
178 return int_ret; 139 return int_ret;
@@ -413,6 +374,7 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
413#include "efl_ui_check.eo.c" 374#include "efl_ui_check.eo.c"
414 375
415#include "efl_ui_check_legacy.eo.h" 376#include "efl_ui_check_legacy.eo.h"
377#include "efl_ui_check_legacy_part.eo.h"
416 378
417#define MY_CLASS_NAME_LEGACY "elm_check" 379#define MY_CLASS_NAME_LEGACY "elm_check"
418 380
@@ -430,6 +392,87 @@ _efl_ui_check_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
430 return obj; 392 return obj;
431} 393}
432 394
395/* FIXME: replicated from elm_layout just because check's icon spot
396 * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
397 * can changed the theme API */
398static void
399_icon_signal_emit(Evas_Object *obj)
400{
401 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
402 char buf[64];
403
404 if (!elm_widget_resize_object_get(obj)) return;
405 snprintf(buf, sizeof(buf), "elm,state,icon,%s",
406 elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
407
408 elm_layout_signal_emit(obj, buf, "elm");
409 edje_object_message_signal_process(wd->resize_obj);
410
411 elm_layout_sizing_eval(obj);
412}
413
414/* FIXME: replicated from elm_layout just because check's icon spot
415 * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
416 * can changed the theme API */
417EOLIAN static Efl_Ui_Theme_Apply
418_efl_ui_check_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED)
419{
420 Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
421
422 int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_CHECK_LEGACY_CLASS));
423 if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
424
425 _icon_signal_emit(obj);
426
427 return int_ret;
428}
429
430/* FIXME: replicated from elm_layout just because check's icon spot
431 * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
432 * can changed the theme API */
433EOLIAN static Eina_Bool
434_efl_ui_check_legacy_efl_ui_widget_widget_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, Evas_Object *sobj)
435{
436 Eina_Bool int_ret = EINA_FALSE;
437
438 int_ret = elm_widget_sub_object_del(efl_super(obj, EFL_UI_CHECK_LEGACY_CLASS), sobj);
439 if (!int_ret) return EINA_FALSE;
440
441 _icon_signal_emit(obj);
442
443 return EINA_TRUE;
444}
445
446/* FIXME: replicated from elm_layout just because check's icon spot
447 * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
448 * can changed the theme API */
449static Eina_Bool
450_efl_ui_check_legacy_content_set(Eo *obj, void *_pd EINA_UNUSED, const char *part, Evas_Object *content)
451{
452 Eina_Bool int_ret = EINA_FALSE;
453
454 int_ret = efl_content_set(efl_part(efl_super(obj, EFL_UI_CHECK_LEGACY_CLASS), part), content);
455 if (!int_ret) return EINA_FALSE;
456
457 _icon_signal_emit(obj);
458
459 return EINA_TRUE;
460}
461
462/* Efl.Part begin */
463
464static Eina_Bool
465_part_is_efl_ui_check_legacy_part(const Eo *obj EINA_UNUSED, const char *part)
466{
467 return eina_streq(part, "elm.swallow.content");
468}
469
470ELM_PART_OVERRIDE_PARTIAL(efl_ui_check_legacy, EFL_UI_CHECK_LEGACY, void, _part_is_efl_ui_check_legacy_part)
471ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_check_legacy, EFL_UI_CHECK_LEGACY, void)
472#include "efl_ui_check_legacy_part.eo.c"
473
474/* Efl.Part end */
475
433EAPI Evas_Object * 476EAPI Evas_Object *
434elm_check_add(Evas_Object *parent) 477elm_check_add(Evas_Object *parent)
435{ 478{
diff --git a/src/lib/elementary/efl_ui_check.eo b/src/lib/elementary/efl_ui_check.eo
index 508d3fa7a7..5784fc9409 100644
--- a/src/lib/elementary/efl_ui_check.eo
+++ b/src/lib/elementary/efl_ui_check.eo
@@ -24,7 +24,6 @@ class Efl.Ui.Check (Efl.Ui.Nstate, Efl.Access.Widget.Action)
24 Efl.Object.constructor; 24 Efl.Object.constructor;
25 Efl.Ui.Widget.on_access_activate; 25 Efl.Ui.Widget.on_access_activate;
26 Efl.Ui.Widget.theme_apply; 26 Efl.Ui.Widget.theme_apply;
27 Efl.Ui.Widget.widget_sub_object_del;
28 Efl.Ui.Widget.widget_event; 27 Efl.Ui.Widget.widget_event;
29 Efl.Ui.Nstate.count { set; } 28 Efl.Ui.Nstate.count { set; }
30 Efl.Ui.Nstate.value { set; } 29 Efl.Ui.Nstate.value { set; }
diff --git a/src/lib/elementary/efl_ui_check_legacy.eo b/src/lib/elementary/efl_ui_check_legacy.eo
index b140077a5a..781e8b9f10 100644
--- a/src/lib/elementary/efl_ui_check_legacy.eo
+++ b/src/lib/elementary/efl_ui_check_legacy.eo
@@ -11,5 +11,8 @@ class Efl.Ui.Check_Legacy (Efl.Ui.Check, Efl.Ui.Legacy)
11 implements { 11 implements {
12 class.constructor; 12 class.constructor;
13 Efl.Object.constructor; 13 Efl.Object.constructor;
14 Efl.Ui.Widget.theme_apply;
15 Efl.Ui.Widget.widget_sub_object_del;
16 Efl.Part.part;
14 } 17 }
15} 18}
diff --git a/src/lib/elementary/efl_ui_check_legacy_part.eo b/src/lib/elementary/efl_ui_check_legacy_part.eo
new file mode 100644
index 0000000000..5abfae7010
--- /dev/null
+++ b/src/lib/elementary/efl_ui_check_legacy_part.eo
@@ -0,0 +1,8 @@
1class Efl.Ui.Check_Legacy.Part (Efl.Ui.Layout.Part_Content)
2{
3 [[Elementary check internal part class]]
4 data: null;
5 implements {
6 Efl.Content.content { set; }
7 }
8}