Fix UI issue / Launch issue / Mediadata issue
[profile/tv/apps/native/filebrowser.git] / res / edc / widgets / button.edc
1 #define STATE_NORMAL 0
2 #define STATE_HIGHLIGHT 1
3
4 group {
5         name: "elm/button/base/fbr_hover_entry";
6         data.item: "focus_highlight" "on";
7         images {
8                 image: FBR_IMAGE_TICK COMP;
9         }
10         script {
11                 public cur_state;
12                 public hide_line;
13         }
14         parts {
15                 part {
16                         name: "bg";
17                         type: RECT;
18                         scale: 1;
19                         description {
20                                 state: "default" 0.0;
21                                 min: 290 72;
22                                 color: 255 255 255 255;
23                         }
24                         description {
25                                 state: "selected" 0.0;
26                                 inherit: "default" 0.0;
27                                 color: 126 128 255 255;
28                         }
29                         description {
30                                 state: "highlight" 0.0;
31                                 inherit: "default" 0.0;
32                                 color: 255 255 255 255;
33                         }
34                 }
35                 part {
36                         name: "division_line";
37                         type: RECT;
38                         scale: 1;
39                         description {
40                                 state: "default" 0.0;
41                                 min: 290 2;
42                                 color: 89 89 89 51;
43                                 rel1 {
44                                         to: "bg";
45                                         relative: 1.0 1.0;
46                                 }
47                                 rel2 {
48                                         to: "bg";
49                                 }
50                                 align: 1.0 1.0;
51                                 fixed: 1 1;
52                         }
53                         description {
54                                 state: "selected" 0.0;
55                                 inherit: "default" 0.0;
56                                 visible: 0;
57                         }
58                         description {
59                                 state: "highlight" 0.0;
60                                 inherit: "default" 0.0;
61                         }
62                 }
63                 part {
64                         name: "padding_text";
65                         type: RECT;
66                         scale: 1;
67                         description {
68                                 state: "default" 0.0;
69                                 min: 40 0;
70                                 rel1 {
71                                         to: "bg";
72                                 }
73                                 rel2 {
74                                         to: "bg";
75                                         relative: 0.0 1.0;
76                                 }
77                                 fixed: 1 0;
78                                 visible: 0;
79                                 align: 0.0 0.0;
80                         }
81                 }
82                 part {
83                         name: "elm.text";
84                         type: TEXT;
85                         mouse_events: 0;
86                         scale: 1;
87                         description {
88                                 state: "default" 0.0;
89                                 min: 170 80;
90                                 rel1 {
91                                         to: "padding_text";
92                                         relative: 1.0 0.0;
93                                 }
94                                 rel2 {
95                                         to: "padding_text";
96                                 }
97                                 text {
98                                         font: FONT_STYLE_REGULAR;
99                                         size: 30;
100                                         align: 0.0 0.5;
101                                 }
102                                 color: 89 89 89 255;
103                                 fixed: 1 1;
104                                 align: 0.0 0.0;
105                         }
106                         description {
107                                 state: "selected" 0.0;
108                                 inherit: "default" 0.0;
109                                 /*text {
110                                         font: FONT_STYLE_MEDIUM;
111                                 }*/
112                                 color: 255 255 255 255;
113                         }
114                         description {
115                                 state: "highlight" 0.0;
116                                 inherit: "default" 0.0;
117                                 /*text {
118                                         font: FONT_STYLE_MEDIUM;
119                                 }*/
120                                 color: 126 128 255 255;
121                         }
122                 }
123                 part {
124                         name: "padding_icon";
125                         type: RECT;
126                         scale: 1;
127                         description {
128                                 state: "default" 0.0;
129                                 min: 20 30;
130                                 rel1 {
131                                         to: "elm.text";
132                                         relative: 1.0 0.0;
133                                 }
134                                 rel2 {
135                                         to: "elm.text";
136                                         relative: 1.0 0.0;
137                                 }
138                                 fixed: 1 1;
139                                 visible: 0;
140                                 align: 0.0 0.0;
141                         }
142                 }
143                 part {
144                         name: "image_part";
145                         mouse_events: 0;
146                         scale: 1;
147                         description {
148                                 state: "default" 0.0;
149                                 min: 20 20;
150                                 rel1 {
151                                         to: "padding_icon";
152                                         relative: 1.0 1.0;
153                                 }
154                                 rel2 {
155                                         to: "padding_icon";
156                                 }
157                                 image.normal: FBR_IMAGE_TICK;
158                                 fixed: 1 1;
159                                 align: 0.0 0.0;
160                                 visible: 0;
161                         }
162                         description {
163                                 state: "selected" 0.0;
164                                 inherit: "default" 0.0;
165                                 visible: 1;
166                         }
167                         description {
168                                 state: "highlight" 0.0;
169                                 inherit: "default" 0.0;
170                                 color: 126 128 255 255;
171                                 visible: 1;
172                         }
173                 }
174         }
175         programs {
176                 program {
177                         name: "load";
178                         signal: "load";
179                         source: "";
180                         script {
181                                 set_int(cur_state, STATE_NORMAL);
182                                 set_int(hide_line, 0);
183                         }
184                 }
185                 program {
186                         name: "button_down";
187                         signal: "mouse,down,1";
188                         source: "bg";
189                         action: SIGNAL_EMIT "elm,action,press" "";
190                 }
191                 program {
192                         name: "button_mouseup";
193                         signal: "mouse,up,1";
194                         source: "bg";
195                         action: SIGNAL_EMIT "elm,action,unpress" "";
196                 }
197                 program {
198                         name: "button_clicked";
199                         signal: "mouse,clicked,1";
200                         source: "bg";
201                         action: SIGNAL_EMIT "elm,action,click" "";
202                 }
203                 program {
204                         name: "focused";
205                         signal: "elm,action,focus";
206                         source: "elm";
207                         script {
208                                 new state;
209                                 state = get_int(cur_state);
210
211                                 if (state == STATE_HIGHLIGHT)
212                                         set_state(PART:"image_part", "selected", 0.0);
213
214                                 set_state(PART:"bg", "selected", 0.0);
215                                 set_state(PART:"division_line", "selected", 0.0);
216                                 set_state(PART:"elm.text", "selected", 0.0);
217                         }
218                 }
219                 program {
220                         name: "unfocused";
221                         signal: "elm,action,unfocus";
222                         source: "elm";
223                         script {
224                                 new state;
225                                 new var;
226                                 new buf[100];
227                                 state = get_int(cur_state);
228
229                                 if (state == STATE_HIGHLIGHT)
230                                         snprintf(buf, sizeof(buf), "highlight");
231                                 else
232                                         snprintf(buf, sizeof(buf), "default");
233
234                                 var = get_int(hide_line);
235                                 set_state(PART:"bg", buf, 0.0);
236                                 if (!var)
237                                         set_state(PART:"division_line", buf, 0.0);
238                                 set_state(PART:"elm.text", buf, 0.0);
239                                 set_state(PART:"image_part", buf, 0.0);
240                         }
241                 }
242                 program {
243                         name: "highlight";
244                         signal: "elm,action,highlight";
245                         source: "elm";
246                         script {
247                                 set_int(cur_state, STATE_HIGHLIGHT);
248                         }
249                         after: "highlight1";
250                 }
251                 program {
252                         name: "highlight1";
253                         action: STATE_SET "highlight" 0.0;
254                         target: "bg";
255                         target: "elm.text";
256                         target: "image_part";
257                         target: "division_line";
258                 }
259                 program {
260                         name: "hide_line";
261                         signal: "elm,action,hideline";
262                         source: "elm";
263                         script {
264                                 set_int(hide_line, 1);
265                                 set_state(PART:"division_line", "selected", 0.0);
266                         }
267                 }
268         }
269 }
270
271 group {
272         name: "elm/button/base/fbr_sourcebtn";
273         data.item: "focus_highlight" "on";
274         images {
275                 image: FBR_IMAGE_PULLDOWN_ARROW COMP;
276                 image: FBR_IMAGE_ROUND_ICON COMP;
277         }
278         script {
279                 public cur_state;
280         }
281         parts {
282                 part {
283                         name: "bg";
284                         scale: 1;
285                         description {
286                                 state: "default" 0.0;
287                                 min: 290 72;
288                                 rel2.relative: 0.0 0.0;
289                                 image {
290                                         normal: FBR_IMAGE_ROUND_ICON;
291                                         border: 4 4 4 4;
292                                         border_scale: 1;
293                                 }
294                                 color: 255 255 255 12;
295                                 align: 0.0 0.0;
296                                 fixed: 1 1;
297                         }
298                         description {
299                                 state: "selected" 0.0;
300                                 inherit: "default" 0.0;
301                                 color: 126 128 255 255;
302                         }
303                         description {
304                                 state: "selected_0" 0.0;
305                                 inherit: "selected" 0.0;
306                                 color: 126 128 255 0;
307                         }
308                         description {
309                                 state: "highlight" 0.0;
310                                 inherit: "default" 0.0;
311                                 color: 255 255 255 255;
312                         }
313                 }
314                 part {
315                         name: "padding_txt";
316                         type: RECT;
317                         scale: 1;
318                         description {
319                                 state: "default" 0.0;
320                                 min: 32 0;
321                                 rel2.relative: 0.0 0.0;
322                                 align: 0.0 0.5;
323                                 fixed: 1 1;
324                                 visible: 0;
325                         }
326                 }
327                 part {
328                         name: "elm.text";
329                         type: TEXT;
330                         scale: 1;
331                         mouse_events: 0;
332                         description {
333                                 state: "default" 0.0;
334                                 min: 0 72;
335                                 rel1 {
336                                         relative: 1.0 0.0;
337                                         to: "padding_txt";
338                                 }
339                                 rel2 {
340                                         relative: 1.0 0.0;
341                                         to: "padding_txt";
342                                 }
343                                 text {
344                                         font: FONT_STYLE_REGULAR;
345                                         size: 30;
346                                         align: 0.0 0.5;
347                                         min: 1 0;
348                                 }
349                                 align: 0.0 0.0;
350                                 color: 175 175 175 255;
351                                 fixed: 1 1;
352                         }
353                         description {
354                                 state: "selected" 0.0;
355                                 inherit: "default" 0.0;
356                                 color: 255 255 255 255;
357                         }
358                         description {
359                                 state: "highlight" 0.0;
360                                 inherit: "default" 0.0;
361                                 color: 126 128 255 255;
362                         }
363                         description {
364                                 state: "disabled" 0.0;
365                                 inherit: "default" 0.0;
366                                 color: 175 175 175 25;
367                         }
368                 }
369                 part {
370                         name: "padding_updown";
371                         type: RECT;
372                         scale: 1;
373                         description {
374                                 state: "default" 0.0;
375                                 min: 10 0;
376                                 rel1 {
377                                         to: "elm.text";
378                                         relative: 1.0 0.0;
379                                 }
380                                 rel2 {
381                                         to: "elm.text";
382                                 }
383                                 align: 0.0 0.5;
384                                 fixed: 1 1;
385                                 visible: 0;
386                         }
387                 }
388                 part {
389                         name: FBR_PART_ELM_SWALLOWICON;
390                         type: SWALLOW;
391                         scale: 1;
392                         description {
393                                 state: "default" 0.0;
394                                 min: 24 24;
395                                 max: 24 24;
396                                 rel1 {
397                                         relative: 1.0 0.0;
398                                         to: "padding_updown";
399                                 }
400                                 rel2 {
401                                         to: "padding_updown";
402                                 }
403                                 align: 0.0 0.5;
404                                 fixed: 1 1;
405                                 color: 193 193 193 255;
406                         }
407                         description {
408                                 state: "focused" 0.0;
409                                 inherit: "default" 0.0;
410                                 color: 255 255 255 255;
411                         }
412                         description {
413                                 state: "highlight" 0.0;
414                                 inherit: "focused" 0.0;
415                         }
416                         description {
417                                 state: "mouse_over" 0.0;
418                                 inherit: "focused" 0.0;
419                         }
420                 }
421                 part {
422                         name: "padding_arrow";
423                         type: RECT;
424                         scale: 1;
425                         description {
426                                 state: "default" 0.0;
427                                 min: 24 0;
428                                 rel1 {
429                                         relative: 1.0 0.0;
430                                         to: "bg";
431                                 }
432                                 rel2 {
433                                         to: "bg";
434                                 }
435                                 align: 1.0 0.5;
436                                 fixed: 1 1;
437                                 visible: 0;
438                         }
439                 }
440                 part {
441                         name: "arrow_img";
442                         type: IMAGE;
443                         scale: 1;
444                         description {
445                                 state: "default" 0.0;
446                                 min: 24 24;
447                                 max: 24 24;
448                                 rel1 {
449                                         relative: 0.0 0.0;
450                                         to: "padding_arrow";
451                                 }
452                                 rel2 {
453                                         relative: 0.0 1.0;
454                                         to: "padding_arrow";
455                                 }
456                                 image.normal: FBR_IMAGE_PULLDOWN_ARROW;
457                                 align: 1.0 0.5;
458                                 fixed: 1 1;
459                         }
460                         description {
461                                 state: "disabled" 0.0;
462                                 inherit: "default" 0.0;
463                                 color: 175 175 175 25;
464                         }
465                 }
466         }
467         programs {
468                 program {
469                         name: "load";
470                         signal: "load";
471                         source: "";
472                         script {
473                                 set_int(cur_state, STATE_NORMAL);
474                         }
475                 }
476                 program {
477                         name: "button_down";
478                         signal: "mouse,down,1";
479                         source: "bg";
480                         action: SIGNAL_EMIT "elm,action,press" "";
481                 }
482                 program {
483                         name: "button_mouseup";
484                         signal: "mouse,up,1";
485                         source: "bg";
486                         action: SIGNAL_EMIT "elm,action,unpress" "";
487                 }
488                 program {
489                         name: "button_clicked";
490                         signal: "mouse,clicked,1";
491                         source: "bg";
492                         action: SIGNAL_EMIT "elm,action,click" "";
493                 }
494                 program {
495                         name: "focused";
496                         signal: "elm,action,focus";
497                         source: "elm";
498                         script {
499                                 set_int(cur_state, STATE_NORMAL);
500                                 set_state(PART:"bg", "selected", 0.0);
501                                 set_state(PART:"elm.text", "selected", 0.0);
502                                 //run_program(PROGRAM:"focus,anim");
503                         }
504                 }
505                 program {
506                         name: "focus,anim";
507                         action: STATE_SET "selected" 0.0;
508                         target: "bg";
509                         target: "elm.text";
510                         target: FBR_PART_ELM_SWALLOWICON;
511                         transition: LINEAR 0.17;
512                 }
513                 program {
514                         name: "unfocused";
515                         signal: "elm,action,unfocus";
516                         source: "elm";
517                         script {
518                                 new state;
519                                 state = get_int(cur_state);
520                                 if (state == STATE_HIGHLIGHT) {
521                                         set_state(PART:"bg", "highlight_0", 0.0);
522                                         set_state(PART:"elm.text", "highlight", 0.0);
523                                         set_state(PART:FBR_PART_ELM_SWALLOWICON, "highlight", 0.0);
524                                         run_program(PROGRAM:"unfocus,high,anim");
525                                 } else {
526                                         //run_program(PROGRAM:"unfocus,default,anim");
527                                         set_state(PART:"bg","default", 0.0);
528                                         set_state(PART:"elm.text","default", 0.0);
529                                 }
530                         }
531                 }
532                 program {
533                         name: "unfocus,high,anim";
534                         action: STATE_SET "highlight" 0.0;
535                         target: "bg";
536                         transition: LINEAR 0.17;
537                 }
538                 program {
539                         name: "unfocus,default,anim";
540                         action: STATE_SET "default" 0.0;
541                         target: "bg";
542                         target: "elm.text";
543                         target: FBR_PART_ELM_SWALLOWICON;
544                         transition: LINEAR 0.17;
545                 }
546                 program {
547                         name: "unfocus";
548                         signal: "unfocused";
549                         source: "";
550                         action: STATE_SET "default" 0.0;
551                         target: "bg";
552                         target: "elm.text";
553                         target: FBR_PART_ELM_SWALLOWICON;
554                 }
555                 program {
556                         name: "highlight";
557                         signal: "highlight";
558                         source: "";
559                         script {
560                                 set_int(cur_state, STATE_HIGHLIGHT);
561                                 set_state(PART:"bg", "highlight", 0.0);
562                                 set_state(PART:"elm.text", "highlight", 0.0);
563                                 set_state(PART:FBR_PART_ELM_SWALLOWICON, "highlight", 0.0);
564                         }
565                 }
566                 program {
567                         name: "unhighlight";
568                         signal: "unhighlight";
569                         source: "";
570                         script {
571                                 set_int(cur_state, STATE_NORMAL);
572                                 set_state(PART:"bg", "default", 0.0);
573                                 set_state(PART:"elm.text", "default", 0.0);
574                                 set_state(PART:FBR_PART_ELM_SWALLOWICON, "default", 0.0);
575                         }
576                 }
577                 program {
578                         name: "enable";
579                         signal: "elm,state,enabled";
580                         source: "elm";
581                         script {
582                                 set_state(PART:"bg", "default", 0.0);
583                                 set_state(PART:"elm.text", "default", 0.0);
584                                 set_state(PART:"arrow_img", "default", 0.0);
585                         }
586                 }
587                 program {
588                         name: "disable";
589                         signal: "elm,state,disabled";
590                         source: "elm";
591                         script{
592                                 set_state(PART:"bg", "disabled", 0.0);
593                                 set_state(PART:"elm.text", "disabled", 0.0);
594                                 set_state(PART:"arrow_img", "disabled", 0.0);
595                         }
596                 }
597         }
598 }
599
600 group {
601         name: "elm/button/base/fbr_sortbtn";
602         inherit: "elm/button/base/fbr_sourcebtn";
603         parts {
604                 part {
605                         name: "bg";
606                         scale: 1;
607                         description {
608                                 state: "default" 0.0;
609                                 color: 0 0 0 76;
610                         }
611                 }
612         }
613 }
614
615
616 group {
617         name: "elm/button/base/fbr_menubtn";
618         data.item: "focus_highlight" "on";
619         images {
620                 image: FBR_GROUPBTN_BG COMP;
621         }
622         parts {
623                 part {
624                         name: "bg";
625                         scale: 1;
626                         description {
627                                 state: "default" 0.0;
628                                 min: 406 87;
629                                 image.normal: FBR_GROUPBTN_BG;
630                                 color: 0 0 0 0;
631                         }
632                         description {
633                                 state: "focused" 0.0;
634                                 inherit: "default" 0.0;
635                                 color: 126 128 255 255;
636                         }
637                         description {
638                                 state: "highlight" 0.0;
639                                 inherit: "default" 0.0;
640                                 color: 126 128 255 51;
641                         }
642                 }
643                 part {
644                         name: "padding_icon";
645                         type: RECT;
646                         scale: 1;
647                         description {
648                                 state: "default" 0.0;
649                                 min: 85 0;
650                                 rel1 {
651                                         to: "bg";
652                                 }
653                                 rel2 {
654                                         to: "bg";
655                                         relative: 0.0 1.0;
656                                 }
657                                 fixed: 1 0;
658                                 visible: 0;
659                                 align: 0.0 0.5;
660                         }
661                 }
662                 part {
663                         name: FBR_PART_ELM_SWALLOWICON;
664                         type: SWALLOW;
665                         mouse_events: 0;
666                         scale: 1;
667                         description {
668                                 state: "default" 0.0;
669                                 min: 40 40;
670                                 rel1 {
671                                         to: "padding_icon";
672                                         relative: 1.0 0.0;
673                                 }
674                                 rel2 {
675                                         to: "padding_icon";
676                                 }
677                                 fixed: 1 0;
678                                 align: 0.0 0.5;
679                         }
680                 }
681                 part {
682                         name: "padding_text";
683                         type: RECT;
684                         scale: 1;
685                         description {
686                                 state: "default" 0.0;
687                                 min: 37 0;
688                                 rel1 {
689                                         to: FBR_PART_ELM_SWALLOWICON;
690                                         relative: 1.0 0.0;
691                                 }
692                                 rel2 {
693                                         to: FBR_PART_ELM_SWALLOWICON;
694                                         relative: 1.0 0.0;
695                                 }
696                                 fixed: 1 1;
697                                 visible: 0;
698                                 align: 0.0 0.0;
699                         }
700                 }
701                 part {
702                         name: "elm.text";
703                         type: TEXT;
704                         mouse_events: 0;
705                         scale: 1;
706                         description {
707                                 state: "default" 0.0;
708                                 min: 219 87;
709                                 rel1 {
710                                         to_x: "padding_text";
711                                         relative: 1.0 0.0;
712                                 }
713                                 rel2 {
714                                         to_x: "padding_text";
715                                         relative: 1.0 1.0;
716                                 }
717                                 text {
718                                         font: FONT_STYLE_REGULAR;
719                                         size: 30;
720                                         align: 0.0 0.5;
721                                 }
722                                 color: 255 255 255 153;
723                                 fixed: 1 1;
724                                 align: 0.0 0.0;
725                         }
726                         description {
727                                 state: "focused" 0.0;
728                                 inherit: "default" 0.0;
729                                 text {
730                                         font: FONT_STYLE_BOLD;
731                                 }
732                                 color: 255 255 255 255;
733                         }
734                         description {
735                                 state: "highlight" 0.0;
736                                 inherit: "default" 0.0;
737                                 text {
738                                         font: FONT_STYLE_MEDIUM;
739                                 }
740                                 color: 255 255 255 255;
741                         }
742                 }
743         }
744         script {
745                 public select_status = 0;
746         }
747         programs {
748                 program {
749                         name: "button_down";
750                         signal: "mouse,down,1";
751                         source: "bg";
752                         action: SIGNAL_EMIT "elm,action,press" "";
753                 }
754                 program {
755                         name: "button_mouseup";
756                         signal: "mouse,up,1";
757                         source: "bg";
758                         action: SIGNAL_EMIT "elm,action,unpress" "";
759                 }
760                 program {
761                         name: "focused";
762                         signal: "elm,action,focus";
763                         source: "elm";
764                         action: STATE_SET "focused" 0.0;
765                         script {
766                                 if (get_int(select_status) != 1) {
767                                         emit("elm,action,click", "");
768                                 }
769                                 set_state(PART:"bg", "focused", 0.0);
770                                 set_state(PART:"elm.text", "focused", 0.0);
771                         }
772                 }
773                 program {
774                         name: "unfocused";
775                         signal: "elm,action,unfocus";
776                         source: "elm";
777                         script {
778                                 if (get_int(select_status) == 1) {
779                                         set_state(PART:"bg", "highlight", 0.0);
780                                         set_state(PART:"elm.text", "highlight", 0.0);
781                                 } else {
782                                         set_state(PART:"bg", "default", 0.0);
783                                         set_state(PART:"elm.text", "default", 0.0);
784                                 }
785                         }
786                 }
787                 program {
788                         name: "select";
789                         signal: FBR_SIGNAL_GROUP_SELECTED;
790                         source: "";
791                         script {
792                                 set_int(select_status, 1);
793                         }
794                 }
795                 program {
796                         name: "unselect";
797                         signal: FBR_SIGNAL_GROUP_UNSELECTED;
798                         source: "";
799                         script {
800                                 set_int(select_status, 0);
801                                 set_state(PART:"bg", "default", 0.0);
802                                 set_state(PART:"elm.text", "default", 0.0);
803                         }
804                 }
805         }
806 }
807