82c9e53f56de7b21405f60a3b09b27f5c0e9ad8f
[profile/tv/apps/native/homescreen.git] / edje / widget / label.edc
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 styles {
18         style {
19                 name, "text_style_24_unfocused_left";
20                 base, "font=TizenSans:style=Bold font_size=24 color=#ffffff align=left";
21         }
22         style {
23                 name, "text_style_24_focused_left";
24                 base, "font=TizenSans:style=Bold font_size=24 color=#ffffff align=left";
25         }
26         style {
27                 name, "text_style_24_unfocused_center";
28                 base, "font=TizenSans:style=Bold font_size=22 color=#ffffff align=center";
29         }
30         style {
31                 name, "text_style_24_focused_center";
32                 base, "font=TizenSans:style=Bold font_size=22 color=#ffffff align=center";
33         }
34         style {
35                 name, "text_style_24_dim_center";
36                 base, "font=TizenSans:style=Bold font_size=22 color=#bdbdbd align=center";
37         }
38         style {
39                 name, "text_style_32_unfocused_left";
40                 base, "font=TizenSans font_size=32 color=#ffffff align=left";
41         }
42         style {
43                 name, "text_style_32_focused_left";
44                 base, "font=TizenSans font_size=32 color=#ffffff align=left";
45         }
46         style {
47                 name, "text_style_40_unfocused_center";
48                 base, "font=TizenSans font_size=40 color=#ffffff align=center";
49         }
50         style {
51                 name, "text_style_40_focused_center";
52                 base, "font=TizenSans font_size=40  color=#ffffff align=center";
53         }
54         style {
55                 name, "text_style_20_unfocused_left";
56                 base, "font=TizenSans font_size=20 color=#ffffff align=left";
57         }
58         style {
59                 name, "text_style_20_focused_left";
60                 base, "font=TizenSans font_size=20  color=#ffffff align=left";
61         }
62         style {
63                 name, "text_style_22_center";
64                 base, "font=TizenSans:style=Bold font_size=22  color=#79889b align=center";
65         }
66         style {
67                 name, "text_style_28_left";
68                 base, "font=TizenSans font_size= 28 color=#45476C align=center";
69         }
70 }
71
72 group {
73         name, "elm/label/base/slide_style_24_left";
74         script {
75                 public g_duration = 0, g_stopslide, g_timer_id, g_anim_id;
76                 public message(Msg_Type:type, id, ...) {
77                         if (type == MSG_FLOAT_SET) {
78                                 new Float:duration;
79                                 duration = getfarg(2);
80                                 set_float(g_duration, duration);
81                         }
82                 }
83                 public slide_to_end_anim(val, Float:pos) {
84                         new stopflag;
85                         new id;
86                         stopflag = get_int(g_stopslide);
87                         if (stopflag == 1)
88                                 return;
89                         set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0);
90                         if (pos >= 1.0) {
91                                 id = timer(0.5, "slide_to_begin", 1);
92                                 set_int(g_timer_id, id);
93                         }
94                 }
95                 public slide_to_end() {
96                         new stopflag;
97                         new id;
98                         new Float:duration;
99                         stopflag = get_int(g_stopslide);
100                         if (stopflag == 1)
101                                 return;
102                         duration = get_float(g_duration);
103                         id = anim(duration, "slide_to_end_anim", 1);
104                         set_int(g_anim_id, id);
105                 }
106                 public slide_to_begin() {
107                         new stopflag;
108                         new id;
109                         stopflag = get_int(g_stopslide);
110                         if (stopflag == 1) return;
111                         set_state(PART:"elm.text", "slide_begin", 0.0);
112                         id = timer(0.5, "slide_to_end", 1);
113                         set_int(g_timer_id, id);
114                 }
115                 public start_slide() {
116                         set_int(g_stopslide, 0);
117                         set_state(PART:"elm.text", "slide_begin", 0.0);
118                         slide_to_end();
119                 }
120                 public stop_slide() {
121                         new id;
122                         set_int(g_stopslide, 1);
123                         id = get_int(g_anim_id);
124                         cancel_anim(id);
125                         id = get_int(g_timer_id);
126                         cancel_timer(id);
127                         set_state(PART:"elm.text", "default", 0.0);
128                 }
129         }
130         parts {
131                 part {
132                         name, "label.text.clip";
133                         type, RECT;
134                         description {
135                                 state, "default" 0.0;
136                         }
137                 }
138                 part {
139                         name, "elm.text";
140                         type, TEXTBLOCK;
141                         scale, 1;
142                         clip_to, "label.text.clip";
143                         description {
144                                 state, "default" 0.0;
145                                 rel1.relative, 0.0 0.0;
146                                 rel2.relative, 1.0 1.0;
147                                 align, 0.0 0.5;
148                                 text {
149                                         style, "text_style_24_unfocused_left";
150                                         align, 0.0 0.0;
151                                         min, 0 1;
152                                 }
153                         }
154                         description {
155                                 state, "slide_end" 0.0;
156                                 inherit, "default" 0.0;
157                                 rel1.relative, 1.0 0.0;
158                                 rel2.relative, 1.0 1.0;
159                                 align, 1.0 0.5;
160                                 text {
161                                         style, "text_style_24_focused_left";
162                                         align, 0.0 0.0;
163                                         min, 1 1;
164                                 }
165                         }
166                         description {
167                                 state, "slide_begin" 0.0;
168                                 inherit, "default" 0.0;
169                                 rel1.relative, 0.0 0.0;
170                                 rel2.relative, 0.0 1.0;
171                                 align, 0.0 0.5;
172                                 text {
173                                         style, "text_style_24_focused_left";
174                                         align, 0.0 0.0;
175                                         min, 1 1;
176                                 }
177                         }
178                 }
179         }
180         programs {
181                 program {
182                         name, "start_slide";
183                         signal, "elm,state,slide,start";
184                         source, "elm";
185                         script {
186                                 start_slide();
187                         }
188                 }
189                 program {
190                         name, "stop_slide";
191                         signal, "elm,state,slide,stop";
192                         source, "elm";
193                         script {
194                                 stop_slide();
195                         }
196                 }
197         }
198 }
199
200 group {
201         name, "elm/label/base/slide_style_20_left";
202         inherit, "elm/label/base/slide_style_24_left";
203         parts {
204                 part {
205                         name, "elm.text";
206                         type, TEXTBLOCK;
207                         scale, 1;
208                         clip_to, "label.text.clip";
209                         description {
210                                 state, "default" 0.0;
211                                 rel1.relative, 0.0 0.0;
212                                 rel2.relative, 1.0 1.0;
213                                 align, 0.0 0.5;
214                                 text {
215                                         style, "text_style_20_unfocused_left";
216                                         align, 0.0 1.0;
217                                         min, 0 1;
218                                 }
219                         }
220                         description {
221                                 state, "slide_end" 0.0;
222                                 inherit, "default" 0.0;
223                                 rel1.relative, 1.0 0.0;
224                                 rel2.relative, 1.0 1.0;
225                                 align, 1.0 0.5;
226                                 text {
227                                         style, "text_style_20_focused_left";
228                                         align, 0.0 1.0;
229                                         min, 1 1;
230                                 }
231                         }
232                         description {
233                                 state, "slide_begin" 0.0;
234                                 inherit, "default" 0.0;
235                                 rel1.relative, 0.0 0.0;
236                                 rel2.relative, 0.0 1.0;
237                                 align, 0.0 0.5;
238                                 text {
239                                         style, "text_style_20_focused_left";
240                                         align, 0.0 1.0;
241                                         min, 1 1;
242                                 }
243                         }
244                         description {
245                                 state, "dim" 0.0;
246                                 inherit, "default" 0.0;
247                                 text.style, "text_style_20_unfocused_left";
248                                 color, 255 255 255 20;
249                         }
250                 }
251                 programs {
252                         program {
253                                 name, "dim,label";
254                                 signal, SIG_DIM_ITEM;
255                                 source, SRC_PROG;
256                                 action, STATE_SET "dim" 0.0;
257                                 transition, LINEAR 0.2;
258                                 target, "elm.text";
259                         }
260                         program {
261                                 name, "undim,label";
262                                 signal, SIG_UNDIM_ITEM;
263                                 source, SRC_PROG;
264                                 action, STATE_SET "default" 0.0;
265                                 transition, LINEAR 0.2;
266                                 target, "elm.text";
267                         }
268                 }
269         }
270 }
271
272 group {
273         name, "elm/label/base/slide_style_40_center";
274         inherit, "elm/label/base/slide_style_24_left";
275         parts {
276                 part {
277                         name, "elm.text";
278                         type, TEXTBLOCK;
279                         scale, 1;
280                         clip_to, "label.text.clip";
281                         description {
282                                 state, "default" 0.0;
283                                 rel1.relative, 0.0 0.0;
284                                 rel2.relative, 1.0 1.0;
285                                 align, 0.0 0.5;
286                                 text {
287                                         style, "text_style_40_unfocused_center";
288                                         align, 0.0 1.0;
289                                         min, 0 1;
290                                 }
291                         }
292                         description {
293                                 state, "slide_end" 0.0;
294                                 inherit, "default" 0.0;
295                                 rel1.relative, 1.0 0.0;
296                                 rel2.relative, 1.0 1.0;
297                                 align, 1.0 0.5;
298                                 text {
299                                         style, "text_style_40_focused_center";
300                                         align, 0.0 1.0;
301                                         min, 1 1;
302                                 }
303                         }
304                         description {
305                                 state, "slide_begin" 0.0;
306                                 inherit, "default" 0.0;
307                                 rel1.relative, 0.0 0.0;
308                                 rel2.relative, 0.0 1.0;
309                                 align, 0.0 0.5;
310                                 text {
311                                         style, "text_style_40_focused_center";
312                                         align, 0.0 1.0;
313                                         min, 1 1;
314                                 }
315                         }
316                         description {
317                                 state, "dim" 0.0;
318                                 inherit, "default" 0.0;
319                                 text.style, "text_style_40_unfocused_center";
320                                 color, 255 255 255 20;
321                         }
322                 }
323                 programs {
324                         program {
325                                 name, "dim,label";
326                                 signal, SIG_DIM_ITEM;
327                                 source, SRC_PROG;
328                                 action, STATE_SET "dim" 0.0;
329                                 transition, LINEAR 0.2;
330                                 target, "elm.text";
331                         }
332                         program {
333                                 name, "undim,label";
334                                 signal, SIG_UNDIM_ITEM;
335                                 source, SRC_PROG;
336                                 action, STATE_SET "default" 0.0;
337                                 transition, LINEAR 0.2;
338                                 target, "elm.text";
339                         }
340                 }
341         }
342 }
343
344 group {
345         name, "elm/label/base/slide_style_32_left";
346         inherit, "elm/label/base/slide_style_24_left";
347         parts {
348                 part {
349                         name, "elm.text";
350                         type, TEXTBLOCK;
351                         scale, 1;
352                         clip_to, "label.text.clip";
353                         description {
354                                 state, "default" 0.0;
355                                 rel1.relative, 0.0 0.0;
356                                 rel2.relative, 1.0 1.0;
357                                 align, 0.0 0.5;
358                                 text {
359                                         style, "text_style_32_unfocused_left";
360                                         align, 0.0 1.0;
361                                         min, 0 1;
362                                 }
363                         }
364                         description {
365                                 state, "slide_end" 0.0;
366                                 inherit, "default" 0.0;
367                                 rel1.relative, 1.0 0.0;
368                                 rel2.relative, 1.0 1.0;
369                                 align, 1.0 0.5;
370                                 text {
371                                         style, "text_style_32_focused_left";
372                                         align, 0.0 1.0;
373                                         min, 1 1;
374                                 }
375                         }
376                         description {
377                                 state, "slide_begin" 0.0;
378                                 inherit, "default" 0.0;
379                                 rel1.relative, 0.0 0.0;
380                                 rel2.relative, 0.0 1.0;
381                                 align, 0.0 0.5;
382                                 text {
383                                         style, "text_style_32_focused_left";
384                                         align, 0.0 1.0;
385                                         min, 1 1;
386                                 }
387                         }
388                         description {
389                                 state, "dim" 0.0;
390                                 inherit, "default" 0.0;
391                                 text.style, "text_style_32_unfocused_left";
392                                 color, 255 255 255 20;
393                         }
394                 }
395                 programs {
396                         program {
397                                 name, "dim,label";
398                                 signal, SIG_DIM_ITEM;
399                                 source, SRC_PROG;
400                                 action, STATE_SET "dim" 0.0;
401                                 transition, LINEAR 0.2;
402                                 target, "elm.text";
403                         }
404                         program {
405                                 name, "undim,label";
406                                 signal, SIG_UNDIM_ITEM;
407                                 source, SRC_PROG;
408                                 action, STATE_SET "default" 0.0;
409                                 transition, LINEAR 0.2;
410                                 target, "elm.text";
411                         }
412                 }
413         }
414 }
415
416 group {
417         name, "elm/label/base/slide_style_24_center";
418         inherit, "elm/label/base/slide_style_24_left";
419         parts {
420                 part {
421                         name, "elm.text";
422                         type, TEXTBLOCK;
423                         scale, 1;
424                         clip_to, "label.text.clip";
425                         description {
426                                 state, "default" 0.0;
427                                 rel1.relative, 0.0 0.0;
428                                 rel2.relative, 1.0 1.0;
429                                 align, 0.0 0.5;
430                                 text {
431                                         style, "text_style_24_unfocused_center";
432                                         align, 0.0 1.0;
433                                         min, 0 1;
434                                 }
435                         }
436                         description {
437                                 state, "slide_end" 0.0;
438                                 inherit, "default" 0.0;
439                                 rel1.relative, 1.0 0.0;
440                                 rel2.relative, 1.0 1.0;
441                                 align, 1.0 0.5;
442                                 text {
443                                         style, "text_style_24_focused_center";
444                                         align, 0.0 1.0;
445                                         min, 1 1;
446                                 }
447                         }
448                         description {
449                                 state, "slide_begin" 0.0;
450                                 inherit, "default" 0.0;
451                                 rel1.relative, 0.0 0.0;
452                                 rel2.relative, 0.0 1.0;
453                                 align, 0.0 0.5;
454                                 text {
455                                         style, "text_style_24_focused_center";
456                                         align, 0.0 1.0;
457                                         min, 1 1;
458                                 }
459                         }
460                         description {
461                                 state, "dim" 0.0;
462                                 inherit, "default" 0.0;
463                                 text.style, "text_style_24_dim_center";
464                                 color, 255 255 255 20;
465                         }
466                 }
467                 programs {
468                         program {
469                                 name, "dim,label";
470                                 signal, SIG_DIM_ITEM;
471                                 source, SRC_PROG;
472                                 action, STATE_SET "dim" 0.0;
473                                 transition, LINEAR 0.2;
474                                 target, "elm.text";
475                         }
476                         program {
477                                 name, "undim,label";
478                                 signal, SIG_UNDIM_ITEM;
479                                 source, SRC_PROG;
480                                 action, STATE_SET "default" 0.0;
481                                 transition, LINEAR 0.2;
482                                 target, "elm.text";
483                         }
484                 }
485         }
486 }
487
488 group {
489         name, "elm/label/base/slide_style_22_center";
490         inherit, "elm/label/base/slide_style_24_left";
491         parts {
492                 part {
493                         name, "elm.text";
494                         type, TEXTBLOCK;
495                         scale, 1;
496                         clip_to, "label.text.clip";
497                         description {
498                                 state, "default" 0.0;
499                                 rel1.relative, 0.0 0.0;
500                                 rel2.relative, 1.0 1.0;
501                                 align, 0.0 0.5;
502                                 text {
503                                         style, "text_style_22_center";
504                                         align, 0.0 1.0;
505                                         min, 0 1;
506                                 }
507                         }
508                         description {
509                                 state, "slide_end" 0.0;
510                                 inherit, "default" 0.0;
511                                 rel1.relative, 1.0 0.0;
512                                 rel2.relative, 1.0 1.0;
513                                 align, 1.0 0.5;
514                                 text {
515                                         style, "text_style_22_center";
516                                         align, 0.0 1.0;
517                                         min, 1 1;
518                                 }
519                         }
520                         description {
521                                 state, "slide_begin" 0.0;
522                                 inherit, "default" 0.0;
523                                 rel1.relative, 0.0 0.0;
524                                 rel2.relative, 0.0 1.0;
525                                 align, 0.0 0.5;
526                                 text {
527                                         style, "text_style_22_center";
528                                         align, 0.0 1.0;
529                                         min, 1 1;
530                                 }
531                         }
532                 }
533         }
534 }
535
536 group {
537         name, "elm/label/base/slide_style_28_left";
538         inherit, "elm/label/base/slide_style_24_left";
539         parts {
540                 part {
541                         name, "elm.text";
542                         type, TEXTBLOCK;
543                         scale, 1;
544                         clip_to, "label.text.clip";
545                         description {
546                                 state, "default" 0.0;
547                                 rel1.relative, 0.0 0.0;
548                                 rel2.relative, 1.0 1.0;
549                                 align, 0.0 0.5;
550                                 text {
551                                         style, "text_style_28_left";
552                                         align, 0.0 1.0;
553                                         min, 0 1;
554                                 }
555                         }
556                         description {
557                                 state, "slide_end" 0.0;
558                                 inherit, "default" 0.0;
559                                 rel1.relative, 1.0 0.0;
560                                 rel2.relative, 1.0 1.0;
561                                 align, 1.0 0.5;
562                                 text {
563                                         style, "text_style_28_left";
564                                         align, 0.0 1.0;
565                                         min, 1 1;
566                                 }
567                         }
568                         description {
569                                 state, "slide_begin" 0.0;
570                                 inherit, "default" 0.0;
571                                 rel1.relative, 0.0 0.0;
572                                 rel2.relative, 0.0 1.0;
573                                 align, 0.0 0.5;
574                                 text {
575                                         style, "text_style_28_left";
576                                         align, 0.0 1.0;
577                                         min, 1 1;
578                                 }
579                         }
580                 }
581         }
582 }