aboutsummaryrefslogtreecommitdiffstats
path: root/data/elementary/themes/edc/efl/radio.edc
blob: d6400584b4790b99e23becbb47e172f297fad266 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
group { "efl/radio";
   images.image: "inset_shadow_circle_tiny.png" COMP;
   images.image: "inset_circle_tiny.png" COMP;
   images.image: "sym_radio_alum.png" COMP;
#define ICON     1
#define LABEL    2
#define MASK     3
#define DISABLE  4
   script {
      public btmode;
      public eval_mode(m) {
         new m1 = m & MASK;
         new d = m & DISABLE;
         if (m1 == (ICON | LABEL)) {
            if (!d) {
               set_state(PART:"efl.content", "visible", 0.0);
               set_state(PART:"sizer.content", "visible", 0.0);
               set_state(PART:"efl.text", "visible", 0.0);
               set_state(PART:"inset", "default", 0.0);
               set_state(PART:"clip", "default", 0.0);
               set_state(PART:"event", "default", 0.0);
            } else {
               set_state(PART:"efl.content", "visible", 0.0);
               set_state(PART:"sizer.content", "visible", 0.0);
               set_state(PART:"efl.text", "disabled_visible", 0.0);
               set_state(PART:"inset", "disabled", 0.0);
               set_state(PART:"clip", "disabled", 0.0);
               set_state(PART:"event", "disabled", 0.0);
            }
         } else if (m1 == (ICON)) {
            if (!d) {
               set_state(PART:"efl.content", "visible", 0.0);
               set_state(PART:"sizer.content", "icononly", 0.0);
               set_state(PART:"efl.text", "default", 0.0);
               set_state(PART:"inset", "default", 0.0);
               set_state(PART:"clip", "default", 0.0);
               set_state(PART:"event", "default", 0.0);
            } else {
               set_state(PART:"efl.content", "visible", 0.0);
               set_state(PART:"sizer.content", "icononly", 0.0);
               set_state(PART:"efl.text", "disabled", 0.0);
               set_state(PART:"inset", "disabled", 0.0);
               set_state(PART:"clip", "disabled", 0.0);
               set_state(PART:"event", "disabled", 0.0);
            }
         } else if (m1 == (LABEL)) {
            if (!d) {
               set_state(PART:"efl.content", "default", 0.0);
               set_state(PART:"sizer.content", "default", 0.0);
               set_state(PART:"efl.text", "visible", 0.0);
               set_state(PART:"inset", "default", 0.0);
               set_state(PART:"clip", "default", 0.0);
               set_state(PART:"event", "default", 0.0);
            } else {
               set_state(PART:"efl.content", "default", 0.0);
               set_state(PART:"sizer.content", "default", 0.0);
               set_state(PART:"efl.text", "disabled_visible", 0.0);
               set_state(PART:"inset", "disabled", 0.0);
               set_state(PART:"clip", "disabled", 0.0);
               set_state(PART:"event", "disabled", 0.0);
            }
         } else {
            if (!d) {
               set_state(PART:"efl.content", "default", 0.0);
               set_state(PART:"sizer.content", "default", 0.0);
               set_state(PART:"efl.text", "default", 0.0);
               set_state(PART:"inset", "default", 0.0);
               set_state(PART:"clip", "default", 0.0);
               set_state(PART:"event", "default", 0.0);
            } else {
               set_state(PART:"efl.content", "default", 0.0);
               set_state(PART:"sizer.content", "default", 0.0);
               set_state(PART:"efl.text", "default", 0.0);
               set_state(PART:"inset", "disabled", 0.0);
               set_state(PART:"clip", "disabled", 0.0);
               set_state(PART:"event", "disabled", 0.0);
            }
         }
      }
   }
   parts {
      part { name: "inset"; mouse_events: 0;
         scale: 1;
         description { state: "default" 0.0;
            rel1.offset: 2 2;
            rel2.relative: 0.0 1.0;
            rel2.offset: 2 -3;
            image.normal: "inset_shadow_circle_tiny.png";
            align: 0.0 0.5;
            min: 13 13;
            max: 13 13;
            fixed: 1 0;
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            image.normal: "inset_circle_tiny.png";
         }
      }
      part { name: "indicator"; mouse_events: 0;
         scale: 1;
         clip_to: "clip";
         description { state: "default" 0.0;
            rel1.to: "inset";
            rel2.to: "inset";
            image.normal: "sym_radio_alum.png";
            min: 11 11;
            max: 11 11;
            visible: 0;
         }
         description { state: "selected" 0.0;
            inherit: "default" 0.0;
            visible: 1;
         }
      }
      part { name: "clip"; type: RECT;
         description { state: "default" 0.0;
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            color: 255 255 255 64;
         }
      }
      part { name: "efl.content"; type: SWALLOW;
         required;
         scale: 1;
         clip_to: "clip";
         description { state: "default" 0.0;
            fixed: 1 0;
            visible: 0;
            align: 0.0 0.5;
            max: 0 0;
            rel1.to_x: "inset";
            rel1.relative: 1.0 0.0;
            rel1.offset: 1 1;
            rel2.to_x: "inset";
            rel2.offset: 1 -2;
            rel2.relative: 1.0 1.0;
         }
         description { state: "visible" 0.0;
            inherit: "default" 0.0;
            visible: 1;
            aspect: 1.0 1.0;
            min: 16 16;
         }
      }
      part { name: "sizer.content"; type: TEXT; mouse_events:  0;
         scale: 1;
         description { state: "default" 0.0;
            fixed: 1 1;
            visible: 0;
            text { font: FN; size: 10;
               min: 0 0;
               text_class: "radio_text";
            }
         }
         description { state: "visible" 0.0;
            inherit: "default" 0.0;
            rel1.to: "efl.content";
            rel2.to: "efl.content";
            text {
               min: 1 1;
               ellipsis: -1;
               text: "M";
            }
         }
         description { state: "icononly" 0.0;
            inherit: "default" 0.0;
            rel1.to: "efl.content";
            rel2.to: "efl.content";
            text {
               min: 1 1;
               ellipsis: -1;
               text: "M";
            }
         }
      }
      part { name: "efl.text"; type: TEXT; mouse_events: 0;
         effect: SHADOW BOTTOM;
         scale: 1;
         required;
         description { state: "default" 0.0;
            rel1.offset: 2 2;
            rel1.to_x: "efl.content";
            rel1.relative: 1.0 0.0;
            rel2.offset: -3 -3;
            color: FN_COL_DEFAULT;
            color_class: "radio_text";
            text { font: FN; size: 10;
              min: 0 0;
              align: 0.0 0.5;
              text_class: "radio";
            }
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            color_class: "radio_text_disabled";
            color3: 255 255 255 255;
         }
         description { state: "visible" 0.0;
            inherit: "default" 0.0;
            visible: 1;
            text.min: 1 1;
            text.ellipsis: -1;
         }
         description { state: "disabled_visible" 0.0;
            inherit: "default" 0.0;
            color_class: "radio_text_disabled";
            color3: 255 255 255 255;
            visible: 1;
            text.min: 1 1;
            text.ellipsis: -1;
         }
      }
      part { name: "event"; type: RECT;
         description { state: "default" 0.0;
            color: 0 0 0 0;
         }
         description { state: "disabled" 0.0;
            inherit: "default" 0.0;
            visible: 0;
         }
      }
   }
   programs {
      program {
         signal: "mouse,clicked,1"; source: "event";
         action: SIGNAL_EMIT "elm,action,radio,toggle" "elm";
      }
      program {
         signal: "elm,state,radio,on"; source: "elm";
         action:  STATE_SET "selected" 0.0;
         target: "indicator";
      }
      program {
         signal: "elm,state,radio,off"; source: "elm";
         action:  STATE_SET "default" 0.0;
         target: "indicator";
      }
      program {
         signal: "elm,state,text,set"; source: "elm";
         script {
            new m = get_int(btmode);
            m |= LABEL; set_int(btmode, m);
            eval_mode(m);
         }
      }
      program {
         signal: "elm,state,text,unset"; source: "elm";
         script {
            new m = get_int(btmode);
            m &= ~LABEL; set_int(btmode, m);
            eval_mode(m);
         }
      }
      program {
         signal: "elm,state,content,set"; source: "elm";
         script {
            new m = get_int(btmode);
            m |= ICON; set_int(btmode, m);
            eval_mode(m);
         }
      }
      program {
         signal: "elm,state,content,unset"; source: "elm";
         script {
            new m = get_int(btmode);
            m &= ~ICON; set_int(btmode, m);
            eval_mode(m);
         }
      }
      program {
         signal: "elm,state,disabled"; source: "elm";
         script {
            new m = get_int(btmode);
            m |= DISABLE; set_int(btmode, m);
            eval_mode(m);
         }
      }
      program {
         signal: "elm,state,enabled"; source: "elm";
         script {
            new m = get_int(btmode);
            m &= ~DISABLE; set_int(btmode, m);
            eval_mode(m);
         }
      }
   }
#undef ICON
#undef LABEL
#undef MASK
#undef DISABLE
}