9d1d8d877b9ce377230c38df175d470529572cc8
[profile/tv/apps/native/air_home.git] / edje / widget / label.edc
1 /*
2  * Copyright (c) 2015 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, "home_label_title";
20                 base, "font=TizenSans font_size=22 color=#686868 align=center";
21         }
22         style {
23                 name, "home_label_title_focus";
24                 base, "font=TizenSans font_size=22 color=#ffffff align=center";
25         }
26         style {
27                 name, "recent_label_title";
28                 base, "font=TizenSans font_size=24 color=#ffffff align=left";
29         }
30         style {
31                 name, "recent_label_subtitle";
32                 base, "font=TizenSans font_size=20 color=#cdcdcd align=left";
33         }
34         style {
35                 name, "action_menu_title";
36                 base, "font=TizenSans font_size=20 color=#686868 align=center";
37         }
38         style {
39                 name, "action_menu_title_focus";
40                 base, "font=TizenSans font_size=20 color=#ffffff align=center";
41         }
42 }
43
44 group {
45         name, "elm/label/base/slide_home_title";
46         script {
47                 public g_duration = 0, g_stopslide, g_timer_id, g_anim_id;
48                 public message(Msg_Type:type, id, ...) {
49                         if (type == MSG_FLOAT_SET) {
50                                 new Float:duration;
51                                 duration = getfarg(2);
52                                 set_float(g_duration, duration);
53                         }
54                 }
55                 public slide_to_end_anim(val, Float:pos) {
56                         new stopflag;
57                         new id;
58                         stopflag = get_int(g_stopslide);
59                         if (stopflag == 1)
60                                 return;
61                         set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0);
62                         if (pos >= 1.0) {
63                                 id = timer(0.5, "slide_to_begin", 1);
64                                 set_int(g_timer_id, id);
65                         }
66                 }
67                 public slide_to_end() {
68                         new stopflag;
69                         new id;
70                         new Float:duration;
71                         stopflag = get_int(g_stopslide);
72                         if (stopflag == 1)
73                                 return;
74                         duration = get_float(g_duration);
75                         id = anim(duration, "slide_to_end_anim", 1);
76                         set_int(g_anim_id, id);
77                 }
78                 public slide_to_begin() {
79                         new stopflag;
80                         new id;
81                         stopflag = get_int(g_stopslide);
82                         if (stopflag == 1) return;
83                         set_state(PART:"elm.text", "slide_begin", 0.0);
84                         id = timer(0.5, "slide_to_end", 1);
85                         set_int(g_timer_id, id);
86                 }
87                 public start_slide() {
88                         set_int(g_stopslide, 0);
89                         set_state(PART:"elm.text", "slide_begin", 0.0);
90                         slide_to_end();
91                 }
92                 public stop_slide() {
93                         new id;
94                         set_int(g_stopslide, 1);
95                         id = get_int(g_anim_id);
96                         cancel_anim(id);
97                         id = get_int(g_timer_id);
98                         cancel_timer(id);
99                         set_state(PART:"elm.text", "default", 0.0);
100                 }
101         }
102         parts {
103                 part {
104                         name, "label.text.clip";
105                         type, RECT;
106                         description {
107                                 state, "default" 0.0;
108                         }
109                 }
110                 part {
111                         name, "elm.text";
112                         type, TEXTBLOCK;
113                         scale, 1;
114                         clip_to, "label.text.clip";
115                         description {
116                                 state, "default" 0.0;
117                                 rel1.relative, 0.0 0.0;
118                                 rel2.relative, 1.0 1.0;
119                                 align, 0.0 0.5;
120                                 text {
121                                         style, "home_label_title";
122                                         align, 0.0 1.0;
123                                         min, 0 1;
124                                 }
125                         }
126                         description {
127                                 state, "slide_end" 0.0;
128                                 inherit, "default" 0.0;
129                                 rel1.relative, 1.0 0.0;
130                                 rel2.relative, 1.0 1.0;
131                                 align, 1.0 0.5;
132                                 text {
133                                         style, "home_label_title";
134                                         align, 0.0 0.0;
135                                         min, 1 1;
136                                         ellipsis, -1.0;
137                                 }
138                         }
139                         description {
140                                 state, "slide_begin" 0.0;
141                                 inherit, "default" 0.0;
142                                 rel1.relative, 0.0 0.0;
143                                 rel2.relative, 0.0 1.0;
144                                 align, 0.0 0.5;
145                                 text {
146                                         style, "home_label_title";
147                                         align, 0.0 0.0;
148                                         min, 1 1;
149                                         ellipsis, -1.0;
150                                 }
151                         }
152                 }
153         }
154         programs {
155                 program {
156                         name, "start_slide";
157                         signal, "elm,state,slide,start";
158                         source, "elm";
159                         script {
160                                 start_slide();
161                         }
162                 }
163                 program {
164                         name, "stop_slide";
165                         signal, "elm,state,slide,stop";
166                         source, "elm";
167                         script {
168                                 stop_slide();
169                         }
170                 }
171         }
172 }
173
174 group {
175         name, "elm/label/base/slide_home_title_focus";
176         inherit, "elm/label/base/slide_home_title";
177         parts {
178                 part {
179                         name, "elm.text";
180                         type, TEXTBLOCK;
181                         scale, 1;
182                         clip_to, "label.text.clip";
183                         description {
184                                 state, "default" 0.0;
185                                 rel1.relative, 0.0 0.0;
186                                 rel2.relative, 1.0 1.0;
187                                 align, 0.0 0.5;
188                                 text {
189                                         style, "home_label_title_focus";
190                                         align, 0.0 1.0;
191                                         min, 0 1;
192                                 }
193                         }
194                         description {
195                                 state, "slide_end" 0.0;
196                                 inherit, "default" 0.0;
197                                 rel1.relative, 1.0 0.0;
198                                 rel2.relative, 1.0 1.0;
199                                 align, 1.0 0.5;
200                                 text {
201                                         style, "home_label_title_focus";
202                                         align, 0.0 0.0;
203                                         min, 1 1;
204                                         ellipsis, -1.0;
205                                 }
206                         }
207                         description {
208                                 state, "slide_begin" 0.0;
209                                 inherit, "default" 0.0;
210                                 rel1.relative, 0.0 0.0;
211                                 rel2.relative, 0.0 1.0;
212                                 align, 0.0 0.5;
213                                 text {
214                                         style, "home_label_title_focus";
215                                         align, 0.0 0.0;
216                                         min, 1 1;
217                                         ellipsis, -1.0;
218                                 }
219                         }
220                 }
221         }
222 }
223
224 group {
225         name, "elm/label/base/slide_recent_title";
226         inherit, "elm/label/base/slide_home_title";
227         parts {
228                 part {
229                         name, "elm.text";
230                         type, TEXTBLOCK;
231                         scale, 1;
232                         clip_to, "label.text.clip";
233                         description {
234                                 state, "default" 0.0;
235                                 rel1.relative, 0.0 0.0;
236                                 rel2.relative, 1.0 1.0;
237                                 align, 0.0 0.5;
238                                 text {
239                                         style, "recent_label_title";
240                                         align, 0.0 1.0;
241                                         min, 0 1;
242                                 }
243                         }
244                         description {
245                                 state, "slide_end" 0.0;
246                                 inherit, "default" 0.0;
247                                 rel1.relative, 1.0 0.0;
248                                 rel2.relative, 1.0 1.0;
249                                 align, 1.0 0.5;
250                                 text {
251                                         style, "recent_label_title";
252                                         align, 0.0 0.0;
253                                         min, 1 1;
254                                         ellipsis, -1.0;
255                                 }
256                         }
257                         description {
258                                 state, "slide_begin" 0.0;
259                                 inherit, "default" 0.0;
260                                 rel1.relative, 0.0 0.0;
261                                 rel2.relative, 0.0 1.0;
262                                 align, 0.0 0.5;
263                                 text {
264                                         style, "recent_label_title";
265                                         align, 0.0 0.0;
266                                         min, 1 1;
267                                         ellipsis, -1.0;
268                                 }
269                         }
270                 }
271         }
272 }
273 group {
274         name, "elm/label/base/slide_recent_subtitle";
275         inherit, "elm/label/base/slide_home_title";
276         parts {
277                 part {
278                         name, "elm.text";
279                         type, TEXTBLOCK;
280                         scale, 1;
281                         clip_to, "label.text.clip";
282                         description {
283                                 state, "default" 0.0;
284                                 rel1.relative, 0.0 0.0;
285                                 rel2.relative, 1.0 1.0;
286                                 align, 0.0 0.5;
287                                 text {
288                                         style, "recent_label_subtitle";
289                                         align, 0.0 1.0;
290                                         min, 0 1;
291                                 }
292                         }
293                         description {
294                                 state, "slide_end" 0.0;
295                                 inherit, "default" 0.0;
296                                 rel1.relative, 1.0 0.0;
297                                 rel2.relative, 1.0 1.0;
298                                 align, 1.0 0.5;
299                                 text {
300                                         style, "recent_label_subtitle";
301                                         align, 0.0 0.0;
302                                         min, 1 1;
303                                         ellipsis, -1.0;
304                                 }
305                         }
306                         description {
307                                 state, "slide_begin" 0.0;
308                                 inherit, "default" 0.0;
309                                 rel1.relative, 0.0 0.0;
310                                 rel2.relative, 0.0 1.0;
311                                 align, 0.0 0.5;
312                                 text {
313                                         style, "recent_label_subtitle";
314                                         align, 0.0 0.0;
315                                         min, 1 1;
316                                         ellipsis, -1.0;
317                                 }
318                         }
319                 }
320         }
321 }
322 group {
323         name, "elm/label/base/slide_action_menu_title";
324         inherit, "elm/label/base/slide_home_title";
325         parts {
326                 part {
327                         name, "elm.text";
328                         type, TEXTBLOCK;
329                         scale, 1;
330                         clip_to, "label.text.clip";
331                         description {
332                                 state, "default" 0.0;
333                                 rel1.relative, 0.0 0.0;
334                                 rel2.relative, 1.0 1.0;
335                                 align, 0.0 0.5;
336                                 text {
337                                         style, "action_menu_title";
338                                         align, 0.0 1.0;
339                                         min, 0 1;
340                                 }
341                         }
342                         description {
343                                 state, "slide_end" 0.0;
344                                 inherit, "default" 0.0;
345                                 rel1.relative, 1.0 0.0;
346                                 rel2.relative, 1.0 1.0;
347                                 align, 1.0 0.5;
348                                 text {
349                                         style, "action_menu_title";
350                                         align, 0.0 0.0;
351                                         min, 1 1;
352                                         ellipsis, -1.0;
353                                 }
354                         }
355                         description {
356                                 state, "slide_begin" 0.0;
357                                 inherit, "default" 0.0;
358                                 rel1.relative, 0.0 0.0;
359                                 rel2.relative, 0.0 1.0;
360                                 align, 0.0 0.5;
361                                 text {
362                                         style, "action_menu_title";
363                                         align, 0.0 0.0;
364                                         min, 1 1;
365                                         ellipsis, -1.0;
366                                 }
367                         }
368                 }
369         }
370 }
371 group {
372         name, "elm/label/base/slide_action_menu_title_focus";
373         inherit, "elm/label/base/slide_home_title";
374         parts {
375                 part {
376                         name, "elm.text";
377                         type, TEXTBLOCK;
378                         scale, 1;
379                         clip_to, "label.text.clip";
380                         description {
381                                 state, "default" 0.0;
382                                 rel1.relative, 0.0 0.0;
383                                 rel2.relative, 1.0 1.0;
384                                 align, 0.0 0.5;
385                                 text {
386                                         style, "action_menu_title_focus";
387                                         align, 0.0 1.0;
388                                         min, 0 1;
389                                 }
390                         }
391                         description {
392                                 state, "slide_end" 0.0;
393                                 inherit, "default" 0.0;
394                                 rel1.relative, 1.0 0.0;
395                                 rel2.relative, 1.0 1.0;
396                                 align, 1.0 0.5;
397                                 text {
398                                         style, "action_menu_title_focus";
399                                         align, 0.0 0.0;
400                                         min, 1 1;
401                                         ellipsis, -1.0;
402                                 }
403                         }
404                         description {
405                                 state, "slide_begin" 0.0;
406                                 inherit, "default" 0.0;
407                                 rel1.relative, 0.0 0.0;
408                                 rel2.relative, 0.0 1.0;
409                                 align, 0.0 0.5;
410                                 text {
411                                         style, "action_menu_title_focus";
412                                         align, 0.0 0.0;
413                                         min, 1 1;
414                                         ellipsis, -1.0;
415                                 }
416                         }
417                 }
418         }
419 }