summaryrefslogtreecommitdiff
path: root/res/resources/edje/button_customized_theme.edc
blob: 144ee67d4f6e75797620f66541c8dd464d3be96d (plain)
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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
/*
 * Copyright (c) 20014-2015 Samsung Electronics Co., Ltd All Rights Reserved
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


 //****************************************************************************//
 // Button
 //****************************************************************************//

#define BUTTON_MIN_WIDTH_INC 50
#define BUTTON_MIN_HEIGHT_INC 78
#define BUTTON_BOTTOM_MIN_WIDTH_INC 118
#define BUTTON_BOTTOM_MIN_HEIGHT_INC 104
#define BUTTON_BG_MIN_HEIGHT_INC 44
#define BUTTON_PADDING_ICON_RIGHT_INC 14
#define BUTTON_PADDING_LEFT_RIGHT_INC 32
#define BUTTON_PADDING_LEFT_ICON_TEXT_INC 56
#define BUTTON_BG_PADDING_LEFT_RIGHT_INC 22
#define BUTTON_PADDING_TOP_HEIGHT_INC 10
#define BUTTON_PADDING_BOTTOM_HEIGHT_INC 14
#define BUTTON_BOTTOM_PADDING_TOP_HEIGHT_INC 22
#define BUTTON_BOTTOM_PADDING_BOTTOM_HEIGHT_INC 28
#define BUTTON_ICON_HEIGHT_INC 80
#define BUTTON_ICON_WIDTH_INC 80
#define BUTTON_ICON_DEFAULT_HEIGHT_INC 60
#define BUTTON_ICON_DEFAULT_WIDTH_INC 60

#define BUTTON_CIRCLE_SIZE_INC  98 98
#define BUTTON_CIRCLE_BASE_SIZE_INC 100 98
#define BUTTON_CIRCLE_EXTENDED_SIZE_INC 100 199
#define BUTTON_CIRCLE_ICON_SIZE_INC 60 60
#define BUTTON_CIRCLE_PADDING_ICON_BOTTOM_INC 13
#define BUTTON_NAVIFRAME_TITLE_BUTTON_SIZE_INC 67 67
#define BUTTON_NAVIFRAME_TITLE_BUTTON_BG_SIZE_INC 67 67
#define BUTTON_NAVIFRAME_TITLE_BUTTON_IMAGE_SIZE_INC 67 67
#define BUTTON_NAVIFRAME_DRAWERS_WIDTH_INC 55
#define BUTTON_NAVIFRAME_DRAWERS_IMAGE_SIZE_INC 55 72
#define BUTTON_NAVIFRAME_BACK_BUTTON_SIZE_INC 80 80

#define BUTTON_NAVIFRAME_TITLE_LEFT_BUTTON_SIZE_INC 150 70
#define BUTTON_NAVIFRAME_TITLE_LEFT_BUTTON_LEFT_PADDING_WIDTH_INC 32
#define BUTTON_NAVIFRAME_TITLE_LEFT_BUTTON_RIGHT_PADDING_WIDTH_INC 23
#define BUTTON_NAVIFRAME_TITLE_RIGHT_BUTTON_LEFT_PADDING_WIDTH_INC 23
#define BUTTON_NAVIFRAME_TITLE_RIGHT_BUTTON_RIGHT_PADDING_WIDTH_INC 32

#define STYLE_TAGS \
	   tag:  "br" "\n";\
	   tag:  "ps" "ps";\
	   tag:  "tab" "\t";\
	   tag:  "b" "+ font_weight=Bold";

#define STYLE_TAG_MATCH \
	   tag:  "match" "+ color=#3db8cc";


collections {

   base_scale: 2.4;


	styles{
		style { name: "button_title_right";
	      base: "color=#ffffffdd align=center font=Tizen:style=Regular font_size=32 text_class=tizen wrap=mixed  ellipsis=1.0";
	      STYLE_TAGS
	   }
	   style { name: "button_title_right_press";
	      base: "color=#ffffffff align=center font=Tizen:style=Regular font_size=32 text_class=tizen wrap=mixed  ellipsis=1.0";
	      STYLE_TAGS
	   }
	   style { name: "button_title_right_dim";
	      base: "color=#ffffff92 align=center font=Tizen:style=Regular font_size=32 text_class=tizen wrap=mixed  ellipsis=1.0";
	      STYLE_TAGS
	   }
	}


   group { name: "elm/button/base/naviframe/title_left_custom";
      script {
         public mouse_down = 0;
         public multi_down = 0;
         public check_disabled = 0;
      }
      parts {
         part { name: "button_bg";
            type: RECT;
            scale: 1;
            mouse_events: 0;
            clip_to: "button_bg_clipper";
            description { state: "default" 0.0;
               min: BUTTON_NAVIFRAME_TITLE_LEFT_BUTTON_SIZE_INC;
               max: BUTTON_NAVIFRAME_TITLE_LEFT_BUTTON_SIZE_INC;
               fixed: 1 1;
               color: 0 0 0 0 ;
            }
            description { state: "pressed" 0.0;
               inherit: "default" 0.0;
               color: 0 0 0 30 ;
            }
         }
         part { name: "button_bg_clipper";
            type: RECT;
            mouse_events: 0;
            description { state: "default" 0.0;
               rel1.to: "button_bg";
               rel2.to: "button_bg";
               color: 255 255 255 255;
            }
            description { state: "pressed" 0.0;
               inherit: "default" 0.0;
               color: 193 193 193 255;
            }
            description { state: "disabled" 0.0;
               inherit: "default" 0.0;
               color: 61 185 204 77;
            }
         }
         part { name: "left_padding";
            type: SPACER;
            scale: 1;
            mouse_events: 0;
            description { state: "default" 0.0;
               min: BUTTON_NAVIFRAME_TITLE_LEFT_BUTTON_LEFT_PADDING_WIDTH_INC 0;
               max: BUTTON_NAVIFRAME_TITLE_LEFT_BUTTON_LEFT_PADDING_WIDTH_INC -1;
               align: 0.0 0.0;
               fixed: 1 1;
               rel1 { to: "button_bg"; relative: 0.0 0.0; }
               rel2 { to: "button_bg"; relative: 0.0 1.0; }
            }
         }
         part { name: "right_padding";
            type: SPACER;
            scale: 1;
            mouse_events: 0;
            description { state: "default" 0.0;
               min: BUTTON_NAVIFRAME_TITLE_LEFT_BUTTON_RIGHT_PADDING_WIDTH_INC 0;
               max: BUTTON_NAVIFRAME_TITLE_LEFT_BUTTON_RIGHT_PADDING_WIDTH_INC -1;
               align: 1.0 0.0;
               fixed: 1 1;
               rel1 { to: "button_bg"; relative: 1.0 0.0; }
               rel2 { to: "button_bg"; relative: 1.0 1.0; }
            }
         }
         part { name: "elm.text";
            type: TEXTBLOCK;
            scale: 1;
            mouse_events: 0;
            description { state: "default" 0.0;
               align: 0.0 0.5;
               rel1 { to: "left_padding"; relative: 1.0 0.0; }
               rel2 { to: "right_padding"; relative: 0.0 1.0; }
               text {
                  style: "button_title_left";
                  min: 0 1;
               }
            }
            description { state: "pressed" 0.0;
               inherit: "default" 0.0;
               text.style: "button_title_left_press";
            }
            description { state: "disabled" 0.0;
               inherit: "default" 0.0;
               text.style: "button_title_left_dim";
            }
         }
         part { name: "over2";
            type: RECT;
            ignore_flags: ON_HOLD;
            description { state: "default" 0.0;
               rel1.to: "button_bg";
               rel2.to: "button_bg";
               color: 0 0 0 0;
            }
         }
         part { name: "over3";
            type: RECT;
            repeat_events: 1;
            description { state: "default" 0.0;
               rel1.to: "button_bg";
               rel2.to: "button_bg";
               color: 0 0 0 0;
            }
         }
         part { name: "disabler";
            type: RECT;
            description { state: "default" 0.0;
               rel1.to: "button_bg";
               rel2.to: "button_bg";
               color: 0 0 0 0;
               visible: 0;
            }
            description { state: "disabled" 0.0;
               inherit: "default" 0.0;
               visible: 1;
            }
         }
      }
      programs {
         program { name: "button_press";
            signal: "mouse,down,1*";
            source: "over2";
            script {
               if ((get_int(multi_down) == 0) && (get_int(mouse_down) == 0))
                 {
                    set_int(mouse_down, 1);
                    set_state(PART:"button_bg", "pressed", 0.0);
                    emit("elm,action,press", "");
                 }
            }
         }
         program { name: "button_unpress";
            signal: "mouse,up,1*";
            source: "over3";
            script {
               if (get_int(mouse_down) == 1)
                 {
                    set_int(mouse_down, 0);
                    set_state(PART:"button_bg", "default", 0.0);
                    emit("elm,action,unpress", "");
                 }
            }
         }
         program { name: "button_click";
            signal: "mouse,clicked,1";
            source: "over2";
            script {
               if (get_int(multi_down) == 0) {
                 run_program(PROGRAM:"play_sound");
                 emit("elm,action,click", "");
               }
            }
         }
         program { name: "play_sound";
            action: RUN_PLUGIN "touch_sound";
         }
         program { name: "key_press";
            signal: "elm,action,pressed";
            source: "elm";
            action: STATE_SET "pressed" 0.0;
            target: "button_bg_clipper";
         }
         program { name: "key_unpress";
            signal: "elm,action,unpressed";
            source: "elm";
            action: STATE_SET "default" 0.0;
            target: "button_bg_clipper";
         }
         program { name: "enable";
            signal: "elm,state,enabled";
            source: "elm";
            action: STATE_SET "default" 0.0;
            target: "button_bg_clipper";
            target: "elm.text";
            target: "disabler";
         }
         program { name: "disable";
            signal: "elm,state,disabled";
            source: "elm";
            action: STATE_SET "disabled" 0.0;
            target: "button_bg_clipper";
            target: "elm.text";
            target: "disabler";
         }
         program {
            name: "multi_down";
            signal: "elm,action,multi,down";
            source: "elm";
            script {
               set_int(multi_down, 1);
            }
         }
         program {
            name: "multi_up";
            signal: "elm,action,multi,up";
            source: "elm";
            script {
               set_int(multi_down, 0);
            }
         }
      }
   }

   group { name: "elm/button/base/naviframe/title_right_custom";
      inherit: "elm/button/base/naviframe/title_left_custom";
      parts {
         part { name: "left_padding";
            type: SPACER;
            scale: 1;
            mouse_events: 0;
            description { state: "default" 0.0;
               min: BUTTON_NAVIFRAME_TITLE_RIGHT_BUTTON_LEFT_PADDING_WIDTH_INC 0;
               max: BUTTON_NAVIFRAME_TITLE_RIGHT_BUTTON_LEFT_PADDING_WIDTH_INC -1;
               align: 0.0 0.0;
               fixed: 1 1;
               rel1 { to: "button_bg"; relative: 0.0 0.0; }
               rel2 { to: "button_bg"; relative: 0.0 1.0; }
            }
         }
         part { name: "right_padding";
            type: SPACER;
            scale: 1;
            mouse_events: 0;
            description { state: "default" 0.0;
               min: BUTTON_NAVIFRAME_TITLE_RIGHT_BUTTON_RIGHT_PADDING_WIDTH_INC 0;
               max: BUTTON_NAVIFRAME_TITLE_RIGHT_BUTTON_RIGHT_PADDING_WIDTH_INC -1;
               align: 1.0 0.0;
               fixed: 1 1;
               rel1 { to: "button_bg"; relative: 1.0 0.0; }
               rel2 { to: "button_bg"; relative: 1.0 1.0; }
            }
         }
         part { name: "elm.text";
            type: TEXTBLOCK;
            scale: 1;
            mouse_events: 0;
            description { state: "default" 0.0;
               align: 1.0 0.5;
               rel1 { to: "left_padding"; relative: 1.0 0.0; }
               rel2 { to: "right_padding"; relative: 0.0 1.0; }
               text {
                  style: "button_title_right";
                  min: 0 1;
               }
            }
            description { state: "pressed" 0.0;
               inherit: "default" 0.0;
               text.style: "button_title_right_press";
            }
            description { state: "disabled" 0.0;
               inherit: "default" 0.0;
               text.style: "button_title_right_dim";
            }
         }
      }
   }

   group { name: "elm/button/base/naviframe/back_btn/custom";
      alias: "elm/button/base/naviframe/end_btn/default";
      images {
         set {
            name: "core_icon_back";
            image {
               image: "icons/core_icon_back.png" COMP;
            }
         }
      }
      script {
         public mouse_down = 0;
         public multi_down = 0;
         public check_disabled = 0;
      }
      parts {
         part { name: "button_bg";
            type: RECT;
            scale: 1;
            mouse_events: 0;
            clip_to: "button_bg_clipper";
            description { state: "default" 0.0;
               min: BUTTON_NAVIFRAME_BACK_BUTTON_SIZE_INC;
               max: BUTTON_NAVIFRAME_BACK_BUTTON_SIZE_INC;
               fixed: 1 1;
               color: 0 0 0 0;
            }
			description { state: "pressed" 0.0;
               inherit: "default" 0.0;
               color: 0 0 0 30;
            }
         }
         part { name: "button_bg_clipper";
            type: RECT;
            mouse_events: 0;
            description { state: "default" 0.0;
               rel1.to: "button_bg";
               rel2.to: "button_bg";
               color: 255 255 255 255;
            }
            description { state: "pressed" 0.0;
               inherit: "default" 0.0;
               color: 193 193 193 255;
            }
         }
         part { name: "button_icon";
            type: IMAGE;
            scale: 1;
            mouse_events: 0;
            description { state: "default" 0.0;
               min: BUTTON_NAVIFRAME_BACK_BUTTON_SIZE_INC;
               max: BUTTON_NAVIFRAME_BACK_BUTTON_SIZE_INC;
               fixed: 1 1;
               color: 255 255 255 255;
               image.normal: "core_icon_back";
            }
         }
         part { name: "over2";
            type: RECT;
            ignore_flags: ON_HOLD;
            description { state: "default" 0.0;
               rel1.to: "button_bg";
               rel2.to: "button_bg";
               color: 0 0 0 0;
            }
         }
         part { name: "over3";
            type: RECT;
            repeat_events: 1;
            description { state: "default" 0.0;
               rel1.to: "button_bg";
               rel2.to: "button_bg";
               color: 0 0 0 0;
            }
         }
         part { name: "disabler";
            type: RECT;
            description { state: "default" 0.0;
               rel1.to: "button_bg";
               rel2.to: "button_bg";
               color: 0 0 0 0;
               visible: 0;
            }
            description { state: "disabled" 0.0;
               inherit: "default" 0.0;
               visible: 1;
            }
         }
      }
      programs {
         program { name: "button_press";
            signal: "mouse,down,1*";
            source: "over2";
            script {
               if ((get_int(multi_down) == 0) && (get_int(mouse_down) == 0))
                 {
                    set_int(mouse_down, 1);
                    set_state(PART:"button_bg", "pressed", 0.0);
                    emit("elm,action,press", "");
                 }
            }
         }
         program { name: "button_unpress";
            signal: "mouse,up,1*";
            source: "over3";
            script {
               if (get_int(mouse_down) == 1)
                 {
                    set_int(mouse_down, 0);
                    set_state(PART:"button_bg", "default", 0.0);
                    emit("elm,action,unpress", "");
                 }
            }
         }
         program { name: "button_click";
            signal: "mouse,clicked,1";
            source: "over2";
            script {
               if (get_int(multi_down) == 0) {
                 run_program(PROGRAM:"play_sound");
                 emit("elm,action,click", "");
               }
            }
         }
         program { name: "play_sound";
            action: RUN_PLUGIN "touch_sound";
         }
         program { name: "key_press";
            signal: "elm,action,pressed";
            source: "elm";
            action: STATE_SET "pressed" 0.0;
            target: "button_bg_clipper";
         }
         program { name: "key_unpress";
            signal: "elm,action,unpressed";
            source: "elm";
            action: STATE_SET "default" 0.0;
            target: "button_bg_clipper";
         }
         program { name: "enable";
            signal: "elm,state,enabled";
            source: "elm";
            action: STATE_SET "default" 0.0;
            target: "button_bg_clipper";
         }
         program { name: "disable";
            signal: "elm,state,disabled";
            source: "elm";
            action: STATE_SET "disabled" 0.0;
            target: "button_bg_clipper";
         }
         program {
            name: "multi_down";
            signal: "elm,action,multi,down";
            source: "elm";
            script {
               set_int(multi_down, 1);
            }
         }
         program {
            name: "multi_up";
            signal: "elm,action,multi,up";
            source: "elm";
            script {
               set_int(multi_down, 0);
            }
         }
      }
   }
}