[elm_label]Applied font size of nbeat-hd theme
[framework/uifw/efl-theme-tizen.git] / themes / groups / label.edc
1 /*
2  *  nbeat-theme
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Seokjae Jeong <seok.j.jeong@samsung.com>, Myoungwoon Roy Kim <Myoungwoon.kim@samsung.com>, Jeonghyun Yun <jh0506.yun@samsung.com>, Jaehwan Kim <jae.hwan.kim@samsung.com>, Chuneon Park <chuneon.park@samsung.com>, Juyung Seo <juyung.seo@samsung.com>, Woohyun Jung <wh0705.jung@samsung.com>, Myungjae Lee <mjae.lee@samsung.com>, Hyoyoung Chang <hyoyoung.chang@samsung.com>, IlKook Yun <ilkook.yun@samsung.com>, CinWoo Kim <cinoo.kim@samsung.com> JiYeon Park <jy0703.park@samsung.com>
7  * 
8  * This library is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU Lesser General Public License as published by the
10  * Free Software Foundation; either version 2.1 of the License, or (at your option)
11  * any later version.
12  * 
13  * This library is distributed in the hope that it will be useful, but WITHOUT ANY
14  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
15  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16  * License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; if not, write to the Free Software Foundation, Inc., 51
20  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  */
23
24 #define TEXT_SLIDE_DURATION 10
25
26       styles {
27          style { name: "textblock_style";
28             base: "font=SLP:style=Medium font_size="LABEL_FONT_SIZE_INC" color="LABEL_TEXT_BLOCK_STYLE_COLOR_INC" text_class=label";
29             tag:  "br" "\n";
30             tag:  "ps" "ps";
31             tag:  "hilight" "+ font=SLP:style=Bold";
32             tag:  "b" "+ font=SLP:style=Bold";
33             tag:  "tab" "\t";
34          }
35       }
36
37       /* label doesn't use it */
38       styles {
39          style { name: "textblock_charwrap_style";
40             base: "font=SLP:style=Medium font_size="LABEL_FONT_SIZE_INC" color="LABEL_TEXT_BLOCK_STYLE_COLOR_INC;
41             tag:  "br" "\n";
42             tag:  "ps" "ps";
43             tag:  "hilight" "+ font=SLP:style=Bold";
44             tag:  "b" "+ font=SLP:style=Bold";
45             tag:  "tab" "\t";
46          }
47       }
48
49       group { name: "elm/label/base/default";
50          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
51          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
52          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
53          parts {
54             part { name: "label.swallow.background";
55                type: SWALLOW;
56                description { state: "default" 0.0;
57                   visible: 1;
58                }
59             }
60             part { name: "label.text.clip";
61                type: RECT;
62                description { state: "default" 0.0;
63                   visible: 1;
64                   color: 255 255 255 255;
65                   rel1 { relative: 0 0; to: "label.swallow.background"; }
66                   rel2 { relative: 1 1; to: "label.swallow.background"; }
67                }
68             }
69             part { name: "elm.text";
70                type: TEXTBLOCK;
71                mouse_events: 0;
72                scale: 1;
73                clip_to: "label.text.clip";
74                description { state: "default" 0.0;
75                   rel1.relative: 0.0 0.0;
76                   rel2.relative: 1.0 1.0;
77                   text {
78                      style: "textblock_style";
79                      min: 0 1;
80                   }
81                }
82             }
83          }
84       }
85
86       /* default label doesn't use it */
87       group { name: "elm/label/base_wrap/default";
88          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
89          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
90          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
91          parts {
92             part { name: "label.swallow.background";
93                type: SWALLOW;
94                description { state: "default" 0.0;
95                   visible: 1;
96                   rel1 { relative: 0 0; to: "elm.text"; }
97                   rel2 { relative: 1 1; to: "elm.text"; }
98                }
99             }
100             part { name: "elm.text";
101                type: TEXTBLOCK;
102                mouse_events: 1;
103                scale: 1;
104                multiline: 1;
105                description { state: "default" 0.0;
106                   text {
107                        style: "textblock_style";
108                        min: 0 1;
109                   }
110                } 
111                description { state: "charwrap_mode" 0.0;
112                   text {
113                      style: "textblock_charwrap_style";
114                      min: 0 1;
115                   }
116                } 
117             }
118          }
119          programs {
120             program { name: "default_on";
121                signal: "elm,state,default";
122                source: "elm";
123                action: STATE_SET "default" 0.0;
124                target: "elm.text";
125             }
126             program { name: "charwrap_on";
127                signal: "elm,state,charwrap";
128                source: "elm";
129                action: STATE_SET "charwrap_mode" 0.0;
130                target: "elm.text";
131             }
132          } // end programs
133       } // end group
134
135       /* default label doesn't use it */
136       group { name: "elm/label/base_wrap_ellipsis/default";
137          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
138          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
139          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
140          parts {
141             part { name: "label.swallow.background";
142                type: SWALLOW;
143                description { state: "default" 0.0;
144                visible: 1;
145                   rel1 { relative: 0 0; to: "elm.text"; }
146                   rel2 { relative: 1 1; to: "elm.text"; }
147                }
148             }
149             part { name: "elm.text";
150                type: TEXTBLOCK;
151                mouse_events: 0;
152                scale: 1;
153                multiline: 1;
154                description { state: "default" 0.0;
155                   // FIXME : fixed for multiline ellipsis.
156                   //         does it need to make another ellipsis style? 
157                   fixed: 0 1; 
158                   text {
159                      style: "textblock_style";
160                      min: 0 1;
161                   }
162                }
163                description { state: "charwrap_mode" 0.0;
164                   // FIXME : fixed for multiline ellipsis.
165                   //         does it need to make another ellipsis style? 
166                   fixed: 0 1; 
167                   text {
168                      style: "textblock_charwrap_style";
169                      min: 0 1;
170                   }
171                }
172             }
173          }
174          programs {
175             program { name: "default_on";
176                signal: "elm,state,default";
177                source: "elm";
178                action: STATE_SET "default" 0.0;
179                target: "elm.text";
180             }
181             program { name: "charwrap_on";
182                signal: "elm,state,charwrap";
183                source: "elm";
184                action: STATE_SET "charwrap_mode" 0.0;
185                target: "elm.text";
186             }
187          } // end programs
188       } // end group
189
190       group { name: "elm/label/base/marker";
191          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
192          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
193          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
194          styles {
195             style { name: "textblock_style2";
196                base: "font=SLP:style=Bold font_size=14 align=center color=#fff wrap=word text_class=label";
197                tag:  "br" "\n";
198                tag:  "ps" "ps";
199                tag:  "hilight" "+ color=#ffff";
200                tag:  "b" "+ color=#ffff";
201                tag:  "tab" "\t";
202             }
203          }
204          parts {
205             part { name: "label.swallow.background";
206                type: SWALLOW;
207                description { state: "default" 0.0;
208                   visible: 1;
209                   rel1 { relative: 0 0; to: "elm.text"; }
210                   rel2 { relative: 1 1; to: "elm.text"; }
211                }
212             }
213             part { name: "elm.text";
214                type: TEXTBLOCK;
215                mouse_events: 0;
216                scale: 1;
217                description { state: "default" 0.0;
218                   text {
219                      style: "textblock_style2";
220                      min: 1 1;
221                   }
222                }
223             }
224          }
225       }
226
227       /* default label doesn't use it */
228       group { name: "elm/label/base_wrap/marker";
229          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
230          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
231          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
232          parts {
233             part { name: "label.swallow.background";
234                type: SWALLOW;
235                description { state: "default" 0.0;
236                   visible: 1;
237                   rel1 { relative: 0 0; to: "elm.text"; }
238                   rel2 { relative: 1 1; to: "elm.text"; }
239                }
240             }
241             part { name: "elm.text";
242                type: TEXTBLOCK;
243                mouse_events: 0;
244                scale: 1;
245                multiline: 1;
246                description { state: "default" 0.0;
247                   text {
248                      style: "textblock_style2";
249                      min: 1 1;
250                   }
251                }
252             }
253          }
254       }
255
256       group { name: "elm/label/base/titlebar/default";
257          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
258          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
259          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
260          parts {
261             part { name: "elm.text";
262                type: TEXT;
263                effect: SHADOW;
264                mouse_events: 0;
265                scale: 1;
266                description { state: "default" 0.0;
267                   text {
268                      font: "SLP:style=Bold";
269                      size: 28;
270                      min: 0 0;
271                      align: 0.0 0.5;
272                   }
273                   color2: 0 0 0 255;
274                }
275             }
276          }
277       }
278
279       group { name: "elm/label/base/titlebar/header";
280          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
281          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
282          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
283          styles {
284             style { name: "header_textblock_style";
285                base: "font=SLP:style=Medium font_size=34 color=#ffffff wrap=mixed";
286                tag:  "br" "\n";
287                tag:  "ps" "ps";
288                tag:  "tab" "\t";
289                tag:  "em" "+ font=SLP:style=Oblique";
290                tag:  "b" "+ font=SLP:style=Bold";
291                tag:  "link" "+ color=#800 underline=on underline_color=#8008";
292                tag:  "hilight" "+ font=SLP:style=Bold";
293             }
294          }
295
296          parts {
297             part { name: "elm.text";
298                type: TEXT;
299                effect: SHADOW;
300                mouse_events: 0;
301                scale: 1;
302                description { state: "default" 0.0;
303                   text {
304                      font:     "SLP:style=Medium";
305                      size:     34;
306                      min:      0 0;
307                      align:    0.0 0.5;
308                   }
309                   color2: 0 0 0 255;
310                }
311             }
312          }
313       }
314
315
316       group { name: "elm/label/base/slide_long";
317          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
318          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
319          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
320
321          script {
322             public g_duration, g_stopslide, g_timer_id, g_anim_id;
323
324             public message(Msg_Type:type, id, ...) {
325                if ((type == MSG_FLOAT_SET) && (id == 0)) {
326                   new Float:duration;
327                   duration = getfarg(2);
328                   set_float(g_duration, duration);
329                }
330             }
331             public slide_to_end_anim(val, Float:pos) {
332                new stopflag;
333                new id;
334                stopflag = get_int(g_stopslide);
335                if (stopflag == 1) return;
336                set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0);
337                if (pos >= 1.0) {
338                   id = timer(0.5, "slide_to_begin", 1);
339                   set_int(g_timer_id, id);
340                }
341             }
342             public slide_to_end() {
343                new stopflag;
344                new id;
345                new Float:duration;
346                stopflag = get_int(g_stopslide);
347                if (stopflag == 1) return;
348                duration = get_float(g_duration);
349                id = anim(duration, "slide_to_end_anim", 1);
350                set_int(g_anim_id, id);
351             }
352             public slide_to_begin() {
353                new stopflag;
354                new id;
355                stopflag = get_int(g_stopslide);
356                if (stopflag == 1) return;
357                set_state(PART:"elm.text", "slide_begin", 0.0);
358                id = timer(0.5, "slide_to_end", 1);
359                set_int(g_timer_id, id);
360             }
361             public start_slide() {
362                set_int(g_stopslide, 0);
363                set_state(PART:"elm.text", "slide_begin", 0.0);
364                slide_to_end();
365             }
366             public stop_slide() {
367                new id;
368                set_int(g_stopslide, 1);
369                id = get_int(g_anim_id);
370                cancel_anim(id);
371                id = get_int(g_timer_id);
372                cancel_timer(id);
373                set_state(PART:"elm.text", "default", 0.0);
374             }
375          }
376
377          parts {
378             part { name: "label.swallow.background";
379                type: SWALLOW;
380                description { state: "default" 0.0;
381                   visible: 1;
382                }
383             }
384             part { name: "label.text.clip";
385                type: RECT;
386                description { state: "default" 0.0;
387                   visible: 1;
388                   color: 255 255 255 255;
389                   rel1 { relative: 0 0; to: "label.swallow.background"; }
390                   rel2 { relative: 1 1; to: "label.swallow.background"; }
391                }
392             }
393             part { name: "elm.text";
394                type: TEXTBLOCK;
395                mouse_events: 0;
396                scale: 1;
397                clip_to: "label.text.clip";
398                description { state: "default" 0.0;
399                   rel1.relative: 0.0 0.0;
400                   rel2.relative: 1.0 1.0;
401                   align: 0.0 0.0;
402                   text {
403                      style: "textblock_style";
404                      min: 1 1;
405                   }
406                }
407                description { state: "slide_end" 0.0;
408                   inherit: "default" 0.0;
409                   rel1.relative: 0.0 0.0;
410                   rel2.relative: 0.0 1.0;
411                   align: 1.0 0.0;
412                }
413                description { state: "slide_begin" 0.0;
414                   inherit: "default" 0.0;
415                   rel1.relative: 1.0 0.0;
416                   rel2.relative: 1.0 1.0;
417                   align: 0.0 0.0;
418                }
419             }
420          }
421          programs {
422             program { name: "start_slide";
423                source: "elm";
424                signal: "elm,state,slide,start";
425                script {
426                   start_slide();
427                }
428             }
429             program { name: "stop_slide";
430                source: "elm";
431                signal: "elm,state,slide,stop";
432                script {
433                   stop_slide();
434                }
435             }
436          }
437       }
438
439
440       group { name: "elm/label/base/slide_short";
441          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
442          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
443          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
444
445          script {
446             public g_duration, g_stopslide, g_timer_id, g_anim_id;
447
448             public message(Msg_Type:type, id, ...) {
449                if ((type == MSG_FLOAT_SET) && (id == 0)) {
450                   new Float:duration;
451                   duration = getfarg(2);
452                   set_float(g_duration, duration);
453                }
454             }
455             public slide_to_end_anim(val, Float:pos) {
456                new stopflag;
457                new id;
458                stopflag = get_int(g_stopslide);
459                if (stopflag == 1) return;
460                set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0);
461                if (pos >= 1.0) {
462                   id = timer(0.5, "slide_to_begin", 1);
463                   set_int(g_timer_id, id);
464                }
465             }
466             public slide_to_end() {
467                new stopflag;
468                new id;
469                new Float:duration;
470                stopflag = get_int(g_stopslide);
471                if (stopflag == 1) return;
472                duration = get_float(g_duration);
473                id = anim(duration, "slide_to_end_anim", 1);
474                set_int(g_anim_id, id);
475             }
476             public slide_to_begin() {
477                new stopflag;
478                new id;
479                stopflag = get_int(g_stopslide);
480                if (stopflag == 1) return;
481                set_state(PART:"elm.text", "slide_begin", 0.0);
482                id = timer(0.5, "slide_to_end", 1);
483                set_int(g_timer_id, id);
484             }
485             public start_slide() {
486                set_int(g_stopslide, 0);
487                set_state(PART:"elm.text", "slide_begin", 0.0);
488                slide_to_end();
489             }
490             public stop_slide() {
491                new id;
492                set_int(g_stopslide, 1);
493                id = get_int(g_anim_id);
494                cancel_anim(id);
495                id = get_int(g_timer_id);
496                cancel_timer(id);
497                set_state(PART:"elm.text", "default", 0.0);
498             }
499          }
500
501          parts {
502             part { name: "label.swallow.background";
503                type: SWALLOW;
504                description { state: "default" 0.0;
505                   visible: 1;
506                }
507             }
508             part { name: "label.text.clip";
509                type: RECT;
510                description { state: "default" 0.0;
511                   visible: 1;
512                   color: 255 255 255 255;
513                   rel1 { relative: 0 0; to: "label.swallow.background"; }
514                   rel2 { relative: 1 1; to: "label.swallow.background"; }
515                }
516             }
517             part { name: "elm.text";
518                type: TEXTBLOCK;
519                mouse_events: 0;
520                scale: 1;
521                clip_to: "label.text.clip";
522                description { state: "default" 0.0;
523                   rel1.relative: 0.0 0.0;
524                   rel2.relative: 1.0 1.0;
525                   align: 0.0 0.0;
526                   text {
527                      style: "textblock_style";
528                      min: 1 1;
529                   }
530                }
531                description { state: "slide_end" 0.0;
532                   inherit: "default" 0.0;
533                   rel1.relative: 1.0 0.0;
534                   rel2.relative: 1.0 1.0;
535                   align: 1.0 0.0;
536                }
537                description { state: "slide_begin" 0.0;
538                   inherit: "default" 0.0;
539                   rel1.relative: 0.0 0.0;
540                   rel2.relative: 0.0 1.0;
541                   align: 0.0 0.0;
542                }
543             }
544          }
545          programs {
546             program { name: "start_slide";
547                source: "elm";
548                signal: "elm,state,slide,start";
549                script {
550                   start_slide();
551                }
552             }
553             program { name: "stop_slide";
554                source: "elm";
555                signal: "elm,state,slide,stop";
556                script {
557                   stop_slide();
558                }
559             }
560          }
561       }
562
563       group { name: "elm/label/base/slide_bounce";
564          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
565          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
566          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
567
568          script {
569             public g_duration, g_stopslide, g_timer_id, g_anim_id;
570
571             public message(Msg_Type:type, id, ...) {
572                if ((type == MSG_FLOAT_SET) && (id == 0)) {
573                   new Float:duration;
574                   duration = getfarg(2);
575                   set_float(g_duration, duration);
576                }
577             }
578             public slide_to_end_anim(val, Float:pos) {
579                new stopflag;
580                new id;
581                stopflag = get_int(g_stopslide);
582                if (stopflag == 1) return;
583                set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0);
584                if (pos >= 1.0) {
585                   id = timer(0.5, "slide_to_begin", 1);
586                   set_int(g_timer_id, id);
587                }
588             }
589             public slide_to_end() {
590                new stopflag;
591                new id;
592                new Float:duration;
593                stopflag = get_int(g_stopslide);
594                if (stopflag == 1) return;
595                duration = get_float(g_duration);
596                id = anim(duration, "slide_to_end_anim", 1);
597                set_int(g_anim_id, id);
598             }
599             public slide_to_begin_anim(val, Float:pos) {
600                new stopflag;
601                new id;
602                stopflag = get_int(g_stopslide);
603                if (stopflag == 1) return;
604                set_tween_state(PART:"elm.text", pos, "slide_end", 0.0, "slide_begin", 0.0);
605                if (pos >= 1.0) {
606                   id = timer(0.5, "slide_to_end", 1);
607                   set_int(g_timer_id, id);
608                }
609             }
610             public slide_to_begin() {
611                new stopflag;
612                new id;
613                new Float:duration;
614                stopflag = get_int(g_stopslide);
615                if (stopflag == 1) return;
616                duration = get_float(g_duration);
617                id = anim(duration, "slide_to_begin_anim", 1);
618                set_int(g_anim_id, id);
619             }
620             public start_slide() {
621                set_int(g_stopslide, 0);
622                set_state(PART:"elm.text", "slide_begin", 0.0);
623                slide_to_end();
624             }
625             public stop_slide() {
626                new id;
627                set_int(g_stopslide, 1);
628                id = get_int(g_anim_id);
629                cancel_anim(id);
630                id = get_int(g_timer_id);
631                cancel_timer(id);
632                set_state(PART:"elm.text", "default", 0.0);
633             }
634          }
635
636          parts {
637             part { name: "label.swallow.background";
638                type: SWALLOW;
639                description { state: "default" 0.0;
640                   visible: 1;
641                }
642             }
643             part { name: "label.text.clip";
644                type: RECT;
645                description { state: "default" 0.0;
646                   visible: 1;
647                   color: 255 255 255 255;
648                   rel1 { relative: 0 0; to: "label.swallow.background"; }
649                   rel2 { relative: 1 1; to: "label.swallow.background"; }
650                }
651             }
652             part { name: "elm.text";
653                type: TEXTBLOCK;
654                mouse_events: 0;
655                scale: 1;
656                clip_to: "label.text.clip";
657                description { state: "default" 0.0;
658                   rel1.relative: 0.0 0.0;
659                   rel2.relative: 1.0 1.0;
660                   align: 0.0 0.0;
661                   text {
662                      style: "textblock_style";
663                      min: 1 1;
664                   }
665                }
666                description { state: "slide_end" 0.0;
667                   inherit: "default" 0.0;
668                   rel1.relative: 1.0 0.0;
669                   rel2.relative: 1.0 1.0;
670                   align: 1.0 0.0;
671                }
672                description { state: "slide_begin" 0.0;
673                   inherit: "default" 0.0;
674                   rel1.relative: 0.0 0.0;
675                   rel2.relative: 0.0 1.0;
676                   align: 0.0 0.0;
677                }
678             }
679          }
680          programs {
681             program { name: "start_slide";
682                source: "elm";
683                signal: "elm,state,slide,start";
684                script {
685                   start_slide();
686                }
687             }
688             program { name: "stop_slide";
689                source: "elm";
690                signal: "elm,state,slide,stop";
691                script {
692                   stop_slide();
693                }
694             }
695          }
696       }