fix the missing text part in dynamic bar and add profile images
[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 }
67
68 group {
69         name, "elm/label/base/slide_style_24_left";
70         script {
71                 public g_duration = 0, g_stopslide, g_timer_id, g_anim_id;
72                 public message(Msg_Type:type, id, ...) {
73                         if (type == MSG_FLOAT_SET) {
74                                 new Float:duration;
75                                 duration = getfarg(2);
76                                 set_float(g_duration, duration);
77                         }
78                 }
79                 public slide_to_end_anim(val, Float:pos) {
80                         new stopflag;
81                         new id;
82                         stopflag = get_int(g_stopslide);
83                         if (stopflag == 1)
84                                 return;
85                         set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0);
86                         if (pos >= 1.0) {
87                                 id = timer(0.5, "slide_to_begin", 1);
88                                 set_int(g_timer_id, id);
89                         }
90                 }
91                 public slide_to_end() {
92                         new stopflag;
93                         new id;
94                         new Float:duration;
95                         stopflag = get_int(g_stopslide);
96                         if (stopflag == 1)
97                                 return;
98                         duration = get_float(g_duration);
99                         id = anim(duration, "slide_to_end_anim", 1);
100                         set_int(g_anim_id, id);
101                 }
102                 public slide_to_begin() {
103                         new stopflag;
104                         new id;
105                         stopflag = get_int(g_stopslide);
106                         if (stopflag == 1) return;
107                         set_state(PART:"elm.text", "slide_begin", 0.0);
108                         id = timer(0.5, "slide_to_end", 1);
109                         set_int(g_timer_id, id);
110                 }
111                 public start_slide() {
112                         set_int(g_stopslide, 0);
113                         set_state(PART:"elm.text", "slide_begin", 0.0);
114                         slide_to_end();
115                 }
116                 public stop_slide() {
117                         new id;
118                         set_int(g_stopslide, 1);
119                         id = get_int(g_anim_id);
120                         cancel_anim(id);
121                         id = get_int(g_timer_id);
122                         cancel_timer(id);
123                         set_state(PART:"elm.text", "default", 0.0);
124                 }
125         }
126         parts {
127                 part {
128                         name, "label.text.clip";
129                         type, RECT;
130                         description {
131                                 state, "default" 0.0;
132                         }
133                 }
134                 part {
135                         name, "elm.text";
136                         type, TEXTBLOCK;
137                         scale, 1;
138                         clip_to, "label.text.clip";
139                         description {
140                                 state, "default" 0.0;
141                                 rel1.relative, 0.0 0.0;
142                                 rel2.relative, 1.0 1.0;
143                                 align, 0.0 0.5;
144                                 text {
145                                         style, "text_style_24_unfocused_left";
146                                         align, 0.0 0.0;
147                                         min, 0 1;
148                                 }
149                         }
150                         description {
151                                 state, "slide_end" 0.0;
152                                 inherit, "default" 0.0;
153                                 rel1.relative, 1.0 0.0;
154                                 rel2.relative, 1.0 1.0;
155                                 align, 1.0 0.5;
156                                 text {
157                                         style, "text_style_24_focused_left";
158                                         align, 0.0 0.0;
159                                         min, 1 1;
160                                 }
161                         }
162                         description {
163                                 state, "slide_begin" 0.0;
164                                 inherit, "default" 0.0;
165                                 rel1.relative, 0.0 0.0;
166                                 rel2.relative, 0.0 1.0;
167                                 align, 0.0 0.5;
168                                 text {
169                                         style, "text_style_24_focused_left";
170                                         align, 0.0 0.0;
171                                         min, 1 1;
172                                 }
173                         }
174                 }
175         }
176         programs {
177                 program {
178                         name, "start_slide";
179                         signal, "elm,state,slide,start";
180                         source, "elm";
181                         script {
182                                 start_slide();
183                         }
184                 }
185                 program {
186                         name, "stop_slide";
187                         signal, "elm,state,slide,stop";
188                         source, "elm";
189                         script {
190                                 stop_slide();
191                         }
192                 }
193         }
194 }
195
196 group {
197         name, "elm/label/base/slide_style_20_left";
198         inherit, "elm/label/base/slide_style_24_left";
199         parts {
200                 part {
201                         name, "elm.text";
202                         type, TEXTBLOCK;
203                         scale, 1;
204                         clip_to, "label.text.clip";
205                         description {
206                                 state, "default" 0.0;
207                                 rel1.relative, 0.0 0.0;
208                                 rel2.relative, 1.0 1.0;
209                                 align, 0.0 0.5;
210                                 text {
211                                         style, "text_style_20_unfocused_left";
212                                         align, 0.0 1.0;
213                                         min, 0 1;
214                                 }
215                         }
216                         description {
217                                 state, "slide_end" 0.0;
218                                 inherit, "default" 0.0;
219                                 rel1.relative, 1.0 0.0;
220                                 rel2.relative, 1.0 1.0;
221                                 align, 1.0 0.5;
222                                 text {
223                                         style, "text_style_20_focused_left";
224                                         align, 0.0 1.0;
225                                         min, 1 1;
226                                 }
227                         }
228                         description {
229                                 state, "slide_begin" 0.0;
230                                 inherit, "default" 0.0;
231                                 rel1.relative, 0.0 0.0;
232                                 rel2.relative, 0.0 1.0;
233                                 align, 0.0 0.5;
234                                 text {
235                                         style, "text_style_20_focused_left";
236                                         align, 0.0 1.0;
237                                         min, 1 1;
238                                 }
239                         }
240                         description {
241                                 state, "dim" 0.0;
242                                 inherit, "default" 0.0;
243                                 text.style, "text_style_20_unfocused_left";
244                                 color, 255 255 255 20;
245                         }
246                 }
247                 programs {
248                         program {
249                                 name, "dim,label";
250                                 signal, SIG_DIM_ITEM;
251                                 source, SRC_PROG;
252                                 action, STATE_SET "dim" 0.0;
253                                 transition, LINEAR 0.2;
254                                 target, "elm.text";
255                         }
256                         program {
257                                 name, "undim,label";
258                                 signal, SIG_UNDIM_ITEM;
259                                 source, SRC_PROG;
260                                 action, STATE_SET "default" 0.0;
261                                 transition, LINEAR 0.2;
262                                 target, "elm.text";
263                         }
264                 }
265         }
266 }
267
268 group {
269         name, "elm/label/base/slide_style_40_center";
270         inherit, "elm/label/base/slide_style_24_left";
271         parts {
272                 part {
273                         name, "elm.text";
274                         type, TEXTBLOCK;
275                         scale, 1;
276                         clip_to, "label.text.clip";
277                         description {
278                                 state, "default" 0.0;
279                                 rel1.relative, 0.0 0.0;
280                                 rel2.relative, 1.0 1.0;
281                                 align, 0.0 0.5;
282                                 text {
283                                         style, "text_style_40_unfocused_center";
284                                         align, 0.0 1.0;
285                                         min, 0 1;
286                                 }
287                         }
288                         description {
289                                 state, "slide_end" 0.0;
290                                 inherit, "default" 0.0;
291                                 rel1.relative, 1.0 0.0;
292                                 rel2.relative, 1.0 1.0;
293                                 align, 1.0 0.5;
294                                 text {
295                                         style, "text_style_40_focused_center";
296                                         align, 0.0 1.0;
297                                         min, 1 1;
298                                 }
299                         }
300                         description {
301                                 state, "slide_begin" 0.0;
302                                 inherit, "default" 0.0;
303                                 rel1.relative, 0.0 0.0;
304                                 rel2.relative, 0.0 1.0;
305                                 align, 0.0 0.5;
306                                 text {
307                                         style, "text_style_40_focused_center";
308                                         align, 0.0 1.0;
309                                         min, 1 1;
310                                 }
311                         }
312                         description {
313                                 state, "dim" 0.0;
314                                 inherit, "default" 0.0;
315                                 text.style, "text_style_40_unfocused_center";
316                                 color, 255 255 255 20;
317                         }
318                 }
319                 programs {
320                         program {
321                                 name, "dim,label";
322                                 signal, SIG_DIM_ITEM;
323                                 source, SRC_PROG;
324                                 action, STATE_SET "dim" 0.0;
325                                 transition, LINEAR 0.2;
326                                 target, "elm.text";
327                         }
328                         program {
329                                 name, "undim,label";
330                                 signal, SIG_UNDIM_ITEM;
331                                 source, SRC_PROG;
332                                 action, STATE_SET "default" 0.0;
333                                 transition, LINEAR 0.2;
334                                 target, "elm.text";
335                         }
336                 }
337         }
338 }
339
340 group {
341         name, "elm/label/base/slide_style_32_left";
342         inherit, "elm/label/base/slide_style_24_left";
343         parts {
344                 part {
345                         name, "elm.text";
346                         type, TEXTBLOCK;
347                         scale, 1;
348                         clip_to, "label.text.clip";
349                         description {
350                                 state, "default" 0.0;
351                                 rel1.relative, 0.0 0.0;
352                                 rel2.relative, 1.0 1.0;
353                                 align, 0.0 0.5;
354                                 text {
355                                         style, "text_style_32_unfocused_left";
356                                         align, 0.0 1.0;
357                                         min, 0 1;
358                                 }
359                         }
360                         description {
361                                 state, "slide_end" 0.0;
362                                 inherit, "default" 0.0;
363                                 rel1.relative, 1.0 0.0;
364                                 rel2.relative, 1.0 1.0;
365                                 align, 1.0 0.5;
366                                 text {
367                                         style, "text_style_32_focused_left";
368                                         align, 0.0 1.0;
369                                         min, 1 1;
370                                 }
371                         }
372                         description {
373                                 state, "slide_begin" 0.0;
374                                 inherit, "default" 0.0;
375                                 rel1.relative, 0.0 0.0;
376                                 rel2.relative, 0.0 1.0;
377                                 align, 0.0 0.5;
378                                 text {
379                                         style, "text_style_32_focused_left";
380                                         align, 0.0 1.0;
381                                         min, 1 1;
382                                 }
383                         }
384                         description {
385                                 state, "dim" 0.0;
386                                 inherit, "default" 0.0;
387                                 text.style, "text_style_32_unfocused_left";
388                                 color, 255 255 255 20;
389                         }
390                 }
391                 programs {
392                         program {
393                                 name, "dim,label";
394                                 signal, SIG_DIM_ITEM;
395                                 source, SRC_PROG;
396                                 action, STATE_SET "dim" 0.0;
397                                 transition, LINEAR 0.2;
398                                 target, "elm.text";
399                         }
400                         program {
401                                 name, "undim,label";
402                                 signal, SIG_UNDIM_ITEM;
403                                 source, SRC_PROG;
404                                 action, STATE_SET "default" 0.0;
405                                 transition, LINEAR 0.2;
406                                 target, "elm.text";
407                         }
408                 }
409         }
410 }
411
412 group {
413         name, "elm/label/base/slide_style_24_center";
414         inherit, "elm/label/base/slide_style_24_left";
415         parts {
416                 part {
417                         name, "elm.text";
418                         type, TEXTBLOCK;
419                         scale, 1;
420                         clip_to, "label.text.clip";
421                         description {
422                                 state, "default" 0.0;
423                                 rel1.relative, 0.0 0.0;
424                                 rel2.relative, 1.0 1.0;
425                                 align, 0.0 0.5;
426                                 text {
427                                         style, "text_style_24_unfocused_center";
428                                         align, 0.0 1.0;
429                                         min, 0 1;
430                                 }
431                         }
432                         description {
433                                 state, "slide_end" 0.0;
434                                 inherit, "default" 0.0;
435                                 rel1.relative, 1.0 0.0;
436                                 rel2.relative, 1.0 1.0;
437                                 align, 1.0 0.5;
438                                 text {
439                                         style, "text_style_24_focused_center";
440                                         align, 0.0 1.0;
441                                         min, 1 1;
442                                 }
443                         }
444                         description {
445                                 state, "slide_begin" 0.0;
446                                 inherit, "default" 0.0;
447                                 rel1.relative, 0.0 0.0;
448                                 rel2.relative, 0.0 1.0;
449                                 align, 0.0 0.5;
450                                 text {
451                                         style, "text_style_24_focused_center";
452                                         align, 0.0 1.0;
453                                         min, 1 1;
454                                 }
455                         }
456                         description {
457                                 state, "dim" 0.0;
458                                 inherit, "default" 0.0;
459                                 text.style, "text_style_24_dim_center";
460                                 color, 255 255 255 20;
461                         }
462                 }
463                 programs {
464                         program {
465                                 name, "dim,label";
466                                 signal, SIG_DIM_ITEM;
467                                 source, SRC_PROG;
468                                 action, STATE_SET "dim" 0.0;
469                                 transition, LINEAR 0.2;
470                                 target, "elm.text";
471                         }
472                         program {
473                                 name, "undim,label";
474                                 signal, SIG_UNDIM_ITEM;
475                                 source, SRC_PROG;
476                                 action, STATE_SET "default" 0.0;
477                                 transition, LINEAR 0.2;
478                                 target, "elm.text";
479                         }
480                 }
481         }
482 }
483
484 group {
485         name, "elm/label/base/slide_style_22_center";
486         inherit, "elm/label/base/slide_style_24_left";
487         parts {
488                 part {
489                         name, "elm.text";
490                         type, TEXTBLOCK;
491                         scale, 1;
492                         clip_to, "label.text.clip";
493                         description {
494                                 state, "default" 0.0;
495                                 rel1.relative, 0.0 0.0;
496                                 rel2.relative, 1.0 1.0;
497                                 align, 0.0 0.5;
498                                 text {
499                                         style, "text_style_22_center";
500                                         align, 0.0 1.0;
501                                         min, 0 1;
502                                 }
503                         }
504                         description {
505                                 state, "slide_end" 0.0;
506                                 inherit, "default" 0.0;
507                                 rel1.relative, 1.0 0.0;
508                                 rel2.relative, 1.0 1.0;
509                                 align, 1.0 0.5;
510                                 text {
511                                         style, "text_style_22_center";
512                                         align, 0.0 1.0;
513                                         min, 1 1;
514                                 }
515                         }
516                         description {
517                                 state, "slide_begin" 0.0;
518                                 inherit, "default" 0.0;
519                                 rel1.relative, 0.0 0.0;
520                                 rel2.relative, 0.0 1.0;
521                                 align, 0.0 0.5;
522                                 text {
523                                         style, "text_style_22_center";
524                                         align, 0.0 1.0;
525                                         min, 1 1;
526                                 }
527                         }
528                 }
529         }
530 }