summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSungTaek Hong <sth253.hong@samsung.com>2016-02-05 08:21:54 +0100
committerCedric BAIL <cedric@osg.samsung.com>2016-02-05 08:45:19 +0100
commit96f1cc1b8c696b917a879974a2f06a5834accb42 (patch)
treec429f948f1abfa12e89d7c4c970deeaa2ebe13ca
parent2df061f1d7d174b17995e477c1d5a40127758ffb (diff)
button: add elm.swallow.background part
Summary: - This swallow part is for custom bg image. - previous bg has to be hid. Reviewers: kimcinoo Differential Revision: https://phab.enlightenment.org/D3657 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to '')
-rw-r--r--legacy/elementary/data/themes/edc/elm/button.edc98
1 files changed, 77 insertions, 21 deletions
diff --git a/legacy/elementary/data/themes/edc/elm/button.edc b/legacy/elementary/data/themes/edc/elm/button.edc
index 9982c17092..d6cfb0870e 100644
--- a/legacy/elementary/data/themes/edc/elm/button.edc
+++ b/legacy/elementary/data/themes/edc/elm/button.edc
@@ -8,12 +8,32 @@ group { name: "elm/button/base/default";
8#define MASK 3 8#define MASK 3
9#define DISABLE 4 9#define DISABLE 4
10#define PRESSED 8 10#define PRESSED 8
11#define BACKGROUND 16
11 script { 12 script {
12 public btmode; 13 public btmode;
13 public eval_mode(m) { 14 public eval_mode(m) {
14 new m1 = m & MASK; 15 new m1 = m & MASK;
15 new d = m & DISABLE; 16 new d = m & DISABLE;
16 new p = m & PRESSED; 17 new p = m & PRESSED;
18 new bg = m & BACKGROUND;
19 if (bg) {
20 set_state(PART:"base", "hidden", 0.0);
21 set_state(PART:"elm.swallow.background", "visible", 0.0);
22 } else {
23 set_state(PART:"elm.swallow.background", "default", 0.0);
24 if (!d) {
25 if (!p)
26 {
27 set_state(PART:"base", "default", 0.0);
28 set_state(PART:"base", "default", 0.0);
29 }
30 else {
31 set_state(PART:"base", "pressed", 0.0);
32 }
33 } else {
34 set_state(PART:"base", "disabled", 0.0);
35 }
36 }
17 if (m1 == (ICON | LABEL)) { 37 if (m1 == (ICON | LABEL)) {
18 if (!d) { 38 if (!d) {
19 set_state(PART:"elm.swallow.content", "visible", 0.0); 39 set_state(PART:"elm.swallow.content", "visible", 0.0);
@@ -22,11 +42,9 @@ group { name: "elm/button/base/default";
22 if (!p) { 42 if (!p) {
23 set_state(PART:"elm.text", "visible", 0.0); 43 set_state(PART:"elm.text", "visible", 0.0);
24 set_state(PART:"icon_clip", "default", 0.0); 44 set_state(PART:"icon_clip", "default", 0.0);
25 set_state(PART:"base", "default", 0.0);
26 } else { 45 } else {
27 set_state(PART:"elm.text", "pressed_visible", 0.0); 46 set_state(PART:"elm.text", "pressed_visible", 0.0);
28 set_state(PART:"icon_clip", "pressed", 0.0); 47 set_state(PART:"icon_clip", "pressed", 0.0);
29 set_state(PART:"base", "pressed", 0.0);
30 } 48 }
31 } else { 49 } else {
32 set_state(PART:"elm.swallow.content", "visible", 0.0); 50 set_state(PART:"elm.swallow.content", "visible", 0.0);
@@ -34,7 +52,6 @@ group { name: "elm/button/base/default";
34 set_state(PART:"elm.text", "disabled_visible", 0.0); 52 set_state(PART:"elm.text", "disabled_visible", 0.0);
35 set_state(PART:"icon_clip", "disabled", 0.0); 53 set_state(PART:"icon_clip", "disabled", 0.0);
36 set_state(PART:"event", "disabled", 0.0); 54 set_state(PART:"event", "disabled", 0.0);
37 set_state(PART:"base", "disabled", 0.0);
38 } 55 }
39 } else if (m1 == (ICON)) { 56 } else if (m1 == (ICON)) {
40 if (!d) { 57 if (!d) {
@@ -42,20 +59,16 @@ group { name: "elm/button/base/default";
42 set_state(PART:"sizer.content", "icononly", 0.0); 59 set_state(PART:"sizer.content", "icononly", 0.0);
43 set_state(PART:"event", "default", 0.0); 60 set_state(PART:"event", "default", 0.0);
44 set_state(PART:"elm.text", "default", 0.0); 61 set_state(PART:"elm.text", "default", 0.0);
45 if (!p) { 62 if (!p)
46 set_state(PART:"icon_clip", "default", 0.0); 63 set_state(PART:"icon_clip", "default", 0.0);
47 set_state(PART:"base", "default", 0.0); 64 else
48 } else {
49 set_state(PART:"icon_clip", "pressed", 0.0); 65 set_state(PART:"icon_clip", "pressed", 0.0);
50 set_state(PART:"base", "pressed", 0.0);
51 }
52 } else { 66 } else {
53 set_state(PART:"elm.swallow.content", "icononly", 0.0); 67 set_state(PART:"elm.swallow.content", "icononly", 0.0);
54 set_state(PART:"sizer.content", "icononly", 0.0); 68 set_state(PART:"sizer.content", "icononly", 0.0);
55 set_state(PART:"elm.text", "default", 0.0); 69 set_state(PART:"elm.text", "default", 0.0);
56 set_state(PART:"icon_clip", "disabled", 0.0); 70 set_state(PART:"icon_clip", "disabled", 0.0);
57 set_state(PART:"event", "disabled", 0.0); 71 set_state(PART:"event", "disabled", 0.0);
58 set_state(PART:"base", "disabled", 0.0);
59 } 72 }
60 } else if (m1 == (LABEL)) { 73 } else if (m1 == (LABEL)) {
61 if (!d) { 74 if (!d) {
@@ -63,20 +76,16 @@ group { name: "elm/button/base/default";
63 set_state(PART:"sizer.content", "default", 0.0); 76 set_state(PART:"sizer.content", "default", 0.0);
64 set_state(PART:"icon_clip", "default", 0.0); 77 set_state(PART:"icon_clip", "default", 0.0);
65 set_state(PART:"event", "default", 0.0); 78 set_state(PART:"event", "default", 0.0);
66 if (!p) { 79 if (!p)
67 set_state(PART:"elm.text", "textonly", 0.0); 80 set_state(PART:"elm.text", "textonly", 0.0);
68 set_state(PART:"base", "default", 0.0); 81 else
69 } else {
70 set_state(PART:"elm.text", "pressed_textonly", 0.0); 82 set_state(PART:"elm.text", "pressed_textonly", 0.0);
71 set_state(PART:"base", "pressed", 0.0);
72 }
73 } else { 83 } else {
74 set_state(PART:"elm.swallow.content", "default", 0.0); 84 set_state(PART:"elm.swallow.content", "default", 0.0);
75 set_state(PART:"sizer.content", "default", 0.0); 85 set_state(PART:"sizer.content", "default", 0.0);
76 set_state(PART:"elm.text", "disabled_textonly", 0.0); 86 set_state(PART:"elm.text", "disabled_textonly", 0.0);
77 set_state(PART:"icon_clip", "disabled", 0.0); 87 set_state(PART:"icon_clip", "disabled", 0.0);
78 set_state(PART:"event", "disabled", 0.0); 88 set_state(PART:"event", "disabled", 0.0);
79 set_state(PART:"base", "disabled", 0.0);
80 } 89 }
81 } else { 90 } else {
82 if (!d) { 91 if (!d) {
@@ -85,18 +94,12 @@ group { name: "elm/button/base/default";
85 set_state(PART:"elm.text", "icononly", 0.0); 94 set_state(PART:"elm.text", "icononly", 0.0);
86 set_state(PART:"icon_clip", "default", 0.0); 95 set_state(PART:"icon_clip", "default", 0.0);
87 set_state(PART:"event", "default", 0.0); 96 set_state(PART:"event", "default", 0.0);
88 if (!p) {
89 set_state(PART:"base", "default", 0.0);
90 } else {
91 set_state(PART:"base", "pressed", 0.0);
92 }
93 } else { 97 } else {
94 set_state(PART:"elm.swallow.content", "default", 0.0); 98 set_state(PART:"elm.swallow.content", "default", 0.0);
95 set_state(PART:"sizer.content", "default", 0.0); 99 set_state(PART:"sizer.content", "default", 0.0);
96 set_state(PART:"elm.text", "icononly", 0.0); 100 set_state(PART:"elm.text", "icononly", 0.0);
97 set_state(PART:"icon_clip", "disabled", 0.0); 101 set_state(PART:"icon_clip", "disabled", 0.0);
98 set_state(PART:"event", "disabled", 0.0); 102 set_state(PART:"event", "disabled", 0.0);
99 set_state(PART:"base", "disabled", 0.0);
100 } 103 }
101 } 104 }
102 } 105 }
@@ -122,6 +125,21 @@ group { name: "elm/button/base/default";
122 inherit: "default"; 125 inherit: "default";
123 color_class: "button_bg_disabled"; 126 color_class: "button_bg_disabled";
124 } 127 }
128 desc { "hidden";
129 inherit: "default";
130 visible: 0;
131 }
132 }
133 swallow { "elm.swallow.background"; nomouse;
134 desc { "default";
135 rel1.to: "base";
136 rel2.to: "base";
137 visible: 0;
138 }
139 desc { "visible";
140 inherit: "default";
141 visible: 1;
142 }
125 } 143 }
126 rect { "icon_clip"; 144 rect { "icon_clip";
127 desc { "default"; 145 desc { "default";
@@ -348,6 +366,22 @@ group { name: "elm/button/base/default";
348 eval_mode(m); 366 eval_mode(m);
349 } 367 }
350 } 368 }
369 program { name: "button_background_visible";
370 signal: "elm,state,background,visible"; source: "elm";
371 script {
372 new m = get_int(btmode);
373 m |= BACKGROUND; set_int(btmode, m);
374 eval_mode(m);
375 }
376 }
377 program { name: "button_background_hidden";
378 signal: "elm,state,background,hidden"; source: "elm";
379 script {
380 new m = get_int(btmode);
381 m &= ~BACKGROUND; set_int(btmode, m);
382 eval_mode(m);
383 }
384 }
351 program { name: "button_state_disabled"; 385 program { name: "button_state_disabled";
352 signal: "elm,state,disabled"; source: "elm"; 386 signal: "elm,state,disabled"; source: "elm";
353 script { 387 script {
@@ -370,6 +404,7 @@ group { name: "elm/button/base/default";
370#undef MASK 404#undef MASK
371#undef DISABLE 405#undef DISABLE
372#undef PRESSED 406#undef PRESSED
407#undef BACKGROUND
373} 408}
374 409
375group { name: "elm/button/base/anchor"; 410group { name: "elm/button/base/anchor";
@@ -465,6 +500,17 @@ group { name: "elm/button/base/anchor";
465 color: 255 255 255 64; 500 color: 255 255 255 64;
466 } 501 }
467 } 502 }
503 swallow { "elm.swallow.background"; nomouse;
504 desc { "default";
505 rel1.to: "base";
506 rel2.to: "base";
507 visible: 0;
508 }
509 desc { "visible";
510 inherit: "default";
511 visible: 1;
512 }
513 }
468 swallow { "elm.swallow.content"; nomouse; 514 swallow { "elm.swallow.content"; nomouse;
469 clip_to: "icon_clip"; 515 clip_to: "icon_clip";
470 desc { "default"; 516 desc { "default";
@@ -708,6 +754,16 @@ group { name: "elm/button/base/anchor";
708 eval_mode(m); 754 eval_mode(m);
709 } 755 }
710 } 756 }
757 program { name: "button_background_visible";
758 signal: "elm,state,background,visible"; source: "elm";
759 action: STATE_SET "visible" 0.0;
760 target: "elm.swallow.background";
761 }
762 program { name: "button_background_hidden";
763 signal: "elm,state,background,hidden"; source: "elm";
764 action: STATE_SET "default" 0.0;
765 target: "elm.swallow.background";
766 }
711 program { name: "button_state_disabled"; 767 program { name: "button_state_disabled";
712 signal: "elm,state,disabled"; source: "elm"; 768 signal: "elm,state,disabled"; source: "elm";
713 script { 769 script {