diff options
author | Sungtaek Hong <sth253.hong@samsung.com> | 2017-03-30 20:23:01 +0900 |
---|---|---|
committer | Sungtaek Hong <sth253.hong@samsung.com> | 2017-04-03 00:16:19 -0700 |
commit | 9d7577a115bff86146d14d284f4d0a621235eb4c (patch) | |
tree | 53d42e113cd15428f12cda0d517a7384c25d3701 | |
parent | 61cfbf91c7871769b6de358095f5fa436de92598 (diff) | |
download | efl-theme-tizen-mobile-9d7577a115bff86146d14d284f4d0a621235eb4c.tar.gz efl-theme-tizen-mobile-9d7577a115bff86146d14d284f4d0a621235eb4c.tar.bz2 efl-theme-tizen-mobile-9d7577a115bff86146d14d284f4d0a621235eb4c.zip |
Label: merge csharp label to default
Change-Id: I5c33b642642b3dd5ed30f17236be998669626c0c
Signed-off-by: Sungtaek Hong <sth253.hong@samsung.com>
-rw-r--r-- | mobile/color_classes.edc | 30 | ||||
-rw-r--r-- | mobile/color_classes_csharp.edc | 44 | ||||
-rw-r--r-- | mobile/elm-sharp-theme-mobile.edc | 1 | ||||
-rw-r--r-- | mobile/widgets/label.edc | 77 | ||||
-rw-r--r-- | mobile/widgets_csharp/label.edc | 758 |
5 files changed, 107 insertions, 803 deletions
diff --git a/mobile/color_classes.edc b/mobile/color_classes.edc index cf51a741..ef234730 100644 --- a/mobile/color_classes.edc +++ b/mobile/color_classes.edc @@ -1307,6 +1307,36 @@ color_classes { color_class { "label/default/text"; color: 0 0 0 255; } + color_class { "label/default/bg"; + color: 0 0 0 0; + } + color_class { "label/default/opacity"; + color: 255 255 255 255; + } + color_class { "label/slide_long/bg"; + color: 0 0 0 0; + } + color_class { "label/slide_long/opacity"; + color: 255 255 255 255; + } + color_class { "label/slide_short/bg"; + color: 0 0 0 0; + } + color_class { "label/slide_short/opacity"; + color: 255 255 255 255; + } + color_class { "label/slide_roll/bg"; + color: 0 0 0 0; + } + color_class { "label/slide_roll/opacity"; + color: 255 255 255 255; + } + color_class { "label/slide_bounce/bg"; + color: 0 0 0 0; + } + color_class { "label/slide_bounce/opacity"; + color: 255 255 255 255; + } /* * Layout diff --git a/mobile/color_classes_csharp.edc b/mobile/color_classes_csharp.edc index 3608c5ec..6c380be1 100644 --- a/mobile/color_classes_csharp.edc +++ b/mobile/color_classes_csharp.edc @@ -15,50 +15,6 @@ color_classes { color: 255 255 255 255; } /* - * Label - */ - color_class { - name: "label/default/bg"; - color: 0 0 0 0; - } - color_class { - name: "label/default/opacity"; - color: 255 255 255 255; - } - color_class { - name: "label/slide_long/bg"; - color: 0 0 0 0; - } - color_class { - name: "label/slide_long/opacity"; - color: 255 255 255 255; - } - color_class { - name: "label/slide_short/bg"; - color: 0 0 0 0; - } - color_class { - name: "label/slide_short/opacity"; - color: 255 255 255 255; - } - color_class { - name: "label/slide_roll/bg"; - color: 0 0 0 0; - } - color_class { - name: "label/slide_roll/opacity"; - color: 255 255 255 255; - } - color_class { - name: "label/slide_bounce/bg"; - color: 0 0 0 0; - } - color_class { - name: "label/slide_bounce/opacity"; - color: 255 255 255 255; - } - - /* * Radio */ color_class { "radio/default/icon"; diff --git a/mobile/elm-sharp-theme-mobile.edc b/mobile/elm-sharp-theme-mobile.edc index 290e6922..86cd8a20 100644 --- a/mobile/elm-sharp-theme-mobile.edc +++ b/mobile/elm-sharp-theme-mobile.edc @@ -83,7 +83,6 @@ collections { #include "color_classes_csharp.edc" -#include "widgets_csharp/label.edc" #include "widgets_csharp/radio.edc" #include "widgets_csharp/layout.edc" diff --git a/mobile/widgets/label.edc b/mobile/widgets/label.edc index 63543e12..945be07c 100644 --- a/mobile/widgets/label.edc +++ b/mobile/widgets/label.edc @@ -99,6 +99,17 @@ group { "elm/label/base/template"; group { "elm/label/base/default"; inherit: "elm/label/base/template"; parts { + rect { "clipper"; + desc { "default"; + color_class: "label/default/opacity"; + } + } + rect { "bg"; + clip: "clipper"; + desc { "default"; + color_class: "label/default/bg"; + } + } textblock { "elm.text"; scale; clip: "clipper"; @@ -134,6 +145,17 @@ group { "elm/label/base/default"; group { "elm/label/base_wrap/default"; inherit: "elm/label/base/template"; parts { + rect { "clipper"; + desc { "default"; + color_class: "label/default/opacity"; + } + } + rect { "bg"; + clip: "clipper"; + desc { "default"; + color_class: "label/default/bg"; + } + } textblock { "elm.text"; scale; multiline: 1; @@ -173,6 +195,17 @@ group { "elm/label/base_wrap/default"; group { "elm/label/base_wrap_ellipsis/default"; inherit: "elm/label/base/template"; parts { + rect { "clipper"; + desc { "default"; + color_class: "label/default/opacity"; + } + } + rect { "bg"; + clip: "clipper"; + desc { "default"; + color_class: "label/default/bg"; + } + } textblock { "elm.text"; scale; multiline: 1; @@ -305,6 +338,17 @@ group { "elm/label/base/slide_long"; } } parts { + rect { "clipper"; + desc { "default"; + color_class: "label/slide_long/opacity"; + } + } + rect { "bg"; + clip: "clipper"; + desc { "default"; + color_class: "label/slide_long/bg"; + } + } textblock { "elm.text"; scale; clip: "clipper"; @@ -431,6 +475,17 @@ group { "elm/label/base/slide_roll"; } } parts { + rect { "clipper"; + desc { "default"; + color_class: "label/slide_roll/opacity"; + } + } + rect { "bg"; + clip: "clipper"; + desc { "default"; + color_class: "label/slide_roll/bg"; + } + } rect { "clipper_elm.text"; nomouse; clip: "clipper"; @@ -589,6 +644,17 @@ group { "elm/label/base/slide_short"; } } parts { + rect { "clipper"; + desc { "default"; + color_class: "label/slide_short/opacity"; + } + } + rect { "bg"; + clip: "clipper"; + desc { "default"; + color_class: "label/slide_short/bg"; + } + } textblock { "elm.text"; scale; clip: "clipper"; @@ -709,6 +775,17 @@ group { "elm/label/base/slide_bounce"; } } parts { + rect { "clipper"; + desc { "default"; + color_class: "label/slide_bounce/opacity"; + } + } + rect { "bg"; + clip: "clipper"; + desc { "default"; + color_class: "label/slide_bounce/bg"; + } + } textblock { "elm.text"; scale; clip: "clipper"; diff --git a/mobile/widgets_csharp/label.edc b/mobile/widgets_csharp/label.edc deleted file mode 100644 index f70d4545..00000000 --- a/mobile/widgets_csharp/label.edc +++ /dev/null @@ -1,758 +0,0 @@ -/* - * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved - * - * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#define SLIDE_SPEED_WEIGHT 0.5 -#define SLIDE_TEXT_GAP 60 -#define SLIDE_TEXT_CHAR_GAP " " //60 (6 spaces) -#define SLIDE_TEXT_MAX_LENGTH (2*(1024+6)) - -styles { - style { "textblock_style"; - base: "font=Tizen:weight=Normal font_size="LABEL_FONT_SIZE_INC" color=#FFF color_class=label/default/text text_class=label"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "hilight" "+ font_weight=Bold"; - tag: "b" "+ font_weight=Bold"; - tag: "tab" "\t"; - } - style { "textblock_charwrap_style"; - base: "font=Tizen:weight=Normal font_size="LABEL_FONT_SIZE_INC" color=#FFF color_class=label/default/text text_class=label"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "hilight" "+ font_weight=Bold"; - tag: "b" "+ font_weight=Bold"; - tag: "tab" "\t"; - } - style { "textblock_style_marker"; - base: "font=Tizen:weight=Bold font_size=14 align=center color=#FFF wrap=word color_class=label/default/text text_class=tizen"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "hilight" "+ font_weight=Bold"; - tag: "b" "+ font_weight=Bold"; - tag: "tab" "\t"; - } -} - -group { "elm/label/event/default"; - inherit_only: 1; - programs { - program { "start_slide"; - source: "elm"; - signal: "elm,state,slide,start"; - after: "on_start_slide"; - } - program { "stop_slide"; - source: "elm"; - signal: "elm,state,slide,stop"; - after: "on_stop_slide"; - } - } -} - -group { "elm/label/base/template"; - inherit: "elm/label/event/default"; - inherit_only: 1; - parts { - rect { "clipper"; - desc { "default"; - } - } - rect { "bg"; - clip: "clipper"; - desc { "default"; - color_class: "label/default/bg"; - } - } - textblock { "elm.text"; - scale; - clip: "clipper"; - desc { "default"; - text.style: "textblock_style"; - } - } - } - programs { - program { "on_start_slide"; - } - program { "on_stop_slide"; - } - } -} - -group { "elm/label/base/default"; - inherit: "elm/label/base/template"; - parts { - rect { "clipper"; - desc { "default"; - color_class: "label/default/opacity"; - } - } - textblock { "elm.text"; - scale; - clip: "clipper"; - desc { "default"; - text { - style: "textblock_style"; - min: 0 1; - align: 0.0 0.0; - } - } - } - } -} - -/* default label doesn't use it */ -group { "elm/label/base_wrap/default"; - inherit: "elm/label/base/template"; - parts { - rect { "clipper"; - desc { "default"; - color_class: "label/default/opacity"; - } - } - textblock { "elm.text"; - scale; - multiline: 1; - desc { "default"; - text { - style: "textblock_style"; - min: 0 1; - align: 0.0 0.0; - } - } - desc { "charwrap_mode"; - text { - style: "textblock_charwrap_style"; - min: 0 1; - align: 0.0 0.0; - } - } - } - } - programs { - program { "default"; - signal: "elm,state,default"; - source: "elm"; - action: STATE_SET "default"; - target: "elm.text"; - } - program { "charwrap"; - signal: "elm,state,charwrap"; - source: "elm"; - action: STATE_SET "charwrap_mode"; - target: "elm.text"; - } - } -} - -/* default label doesn't use it */ -group { "elm/label/base_wrap_ellipsis/default"; - inherit: "elm/label/base/template"; - parts { - rect { "clipper"; - desc { "default"; - color_class: "label/default/opacity"; - } - } - textblock { "elm.text"; - scale; - multiline: 1; - desc { "default"; - fixed: 0 1; - text { - style: "textblock_style"; - min: 0 1; - align: 0.0 0.0; - } - } - desc { "charwrap_mode"; - fixed: 0 1; - text { - style: "textblock_charwrap_style"; - min: 0 1; - align: 0.0 0.0; - } - } - } - } - programs { - program { "default"; - signal: "elm,state,default"; - source: "elm"; - action: STATE_SET "default"; - target: "elm.text"; - } - program { "charwrap"; - signal: "elm,state,charwrap"; - source: "elm"; - action: STATE_SET "charwrap_mode"; - target: "elm.text"; - } - } -} - -group { "elm/label/base/slide_long"; - inherit: "elm/label/base/template"; - script { - public g_duration = 0, g_stopslide, g_timer_id, g_anim_id; - - public message(Msg_Type:type, id, ...) { - if (type == MSG_FLOAT_SET) { - new Float:duration; - duration = getfarg(2); - if (id == 0) - set_float(g_duration, duration); - else - set_float(g_duration, duration / LABEL_FONT_SIZE_INC * SLIDE_SPEED_WEIGHT); - } - } - public slide_to_end_anim(val, Float:pos) { - new stopflag; - new id; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0); - if (pos >= 1.0) { - id = timer(0.5, "slide_to_begin", 1); - set_int(g_timer_id, id); - } - } - public slide_to_end() { - new stopflag; - new id; - new Float:duration; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - duration = get_float(g_duration); - id = anim(duration, "slide_to_end_anim", 1); - set_int(g_anim_id, id); - } - public slide_to_begin() { - new stopflag; - new id; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - set_state(PART:"elm.text", "slide_begin", 0.0); - id = timer(0.5, "slide_to_end", 1); - set_int(g_timer_id, id); - } - public start_slide() { - set_int(g_stopslide, 0); - set_state(PART:"elm.text", "slide_begin", 0.0); - slide_to_end(); - } - public stop_slide() { - new id; - set_int(g_stopslide, 1); - id = get_int(g_anim_id); - cancel_anim(id); - id = get_int(g_timer_id); - cancel_timer(id); - set_state(PART:"elm.text", "default", 0.0); - } - } - parts { - rect { "bg"; - desc { "default"; - color_class: "label/slide_long/bg"; - } - } - rect { "clipper"; - desc { "default"; - color_class: "label/slide_long/opacity"; - } - } - textblock { "elm.text"; - scale; - clip: "clipper"; - desc { "default"; - align: 0.0 0.0; - text { - style: "textblock_style"; - min: 0 1; - align: 0.0 0.0; - } - } - desc { "slide_end"; - inherit: "default"; - rel2.relative: 0.0 1.0; - align: 1.0 0.0; - text { - style: "textblock_style"; - min: 1 1; - align: 0.0 0.0; - } - } - desc { "slide_begin"; - inherit: "default"; - rel1.relative: 1.0 0.0; - text { - style: "textblock_style"; - min: 1 1; - align: 0.0 0.0; - } - } - } - } - programs { - program { "on_start_slide"; - script { - start_slide(); - } - } - program { "on_stop_slide"; - script { - stop_slide(); - } - } - } -} - -group { "elm/label/base/slide_roll"; - inherit: "elm/label/base/template"; - script { - public g_duration = 0; - public g_stopslide = 0; - public g_timer_id = 0; - public g_anim_id = 0; - public g_tb_w = 0; - public g_tb_h = LABEL_FONT_SIZE_INC; - public org_text = 0; - public message(Msg_Type:type, id, ...) { - if (type == MSG_FLOAT_SET) { - new Float:duration; - duration = getfarg(2); - if (id == 0) - set_float(g_duration, duration); - else - set_float(g_duration, duration / get_int(g_tb_h) * SLIDE_SPEED_WEIGHT); - } - } - public get_tb_width() { - new x, y, w, h; - set_state(PART:"elm.text", "no_ellipsis", 0.0); - get_geometry(PART:"elm.text", x, y, w, h); - set_int(g_tb_w, w); - set_int(g_tb_h, h); - set_state(PART:"clipper_elm.text", "default", 0.0); - get_geometry(PART:"clipper_elm.text", x, y, w, h); - set_int(org_text, w); - } - public slide_to_end_anim(val, Float:pos) { - if (get_int(g_stopslide)) return; - set_tween_state(PART:"elm.text.slide", pos*0.5, "slide_begin", 0.0, "slide_end", 0.0); - if (pos >= 1.0) { - set_int(g_timer_id, timer(1.5, "start_slide", 0)); - } - } - public slide_to_end() { - if (get_int(g_stopslide)) return; - set_int(g_anim_id, anim(get_float(g_duration), "slide_to_end_anim", 0)); - } - public start_slide(val) { - new Float:len; - set_int(g_stopslide, 0); - get_tb_width(); - if (!get_float(g_duration)) { - len = get_int(g_tb_w); - set_float(g_duration, len / get_int(g_tb_h) * SLIDE_SPEED_WEIGHT); - } - if(get_int(g_tb_w) > get_int(org_text)) { - run_program(PROGRAM:"slide_text_set"); - set_state(PART:"elm.text.slide", "slide_begin", 0.0); - set_state(PART:"clipper_elm.text", "hide", 0.0); - set_state(PART:"clipper_elm.text.slide", "show", 0.0); - slide_to_end(); - } - } - public stop_slide() { - new slide_start_timer; - new slide_anim_id; - set_int(g_stopslide, 1); - set_float(g_duration, 0); - slide_start_timer = get_int(g_timer_id); - if (slide_start_timer) { - cancel_timer(slide_start_timer); - set_int(g_timer_id, 0); - } - slide_anim_id = get_int(g_anim_id); - if (slide_anim_id) { - cancel_anim(slide_anim_id); - set_int(g_anim_id, 0); - } - set_text(PART:"elm.text.slide", ""); - set_state(PART:"elm.text", "default", 0.0); - set_state(PART:"elm.text.slide", "default", 0.0); - set_state(PART:"clipper_elm.text", "default", 0.0); - set_state(PART:"clipper_elm.text.slide", "default", 0.0); - } - } - parts { - rect { "bg"; - desc { "default"; - color_class: "label/slide_roll/bg"; - } - } - rect { "clipper"; - desc { "default"; - color_class: "label/slide_roll/opacity"; - } - } - rect { "clipper_elm.text"; - nomouse; - clip: "clipper"; - desc { "default"; - } - desc { "hide"; - inherit: "default"; - hid; - } - } - textblock { "elm.text"; - scale; - clip: "clipper_elm.text"; - desc { "default"; - align: 0.0 0.5; - text { - style: "textblock_style"; - min: 0 1; - } - } - desc { "no_ellipsis"; - inherit: "default"; - text.min: 1 1; - } - } - rect { "clipper_elm.text.slide"; - nomouse; - clip: "clipper"; - desc { "default"; - hid; - } - desc { "show"; - inherit: "default"; - vis; - } - } - spacer { "slide_text_gap"; - scale; - desc { "default"; - fixed: 1 0; - min: SLIDE_TEXT_GAP 0; - max: SLIDE_TEXT_GAP -1; - align: 1.0 0.5; - rel2.relative: 0.0 1.0; - } - } - textblock { "elm.text.slide"; - scale; - clip: "clipper_elm.text.slide"; - desc { "default"; - align: 0.0 0.5; - text { - style: "textblock_style"; - min: 0 1; - } - } - desc { "slide_begin"; - inherit: "default"; - text.min: 1 1; - rel2.relative: 0.0 1.0; - } - desc { "slide_end"; - inherit: "default"; - align: 1.0 0.5; - text.min: 1 1; - text.align: 1.0 0.5; - rel.to: "slide_text_gap"; - } - } - } - programs { - program { "slide_text_set"; - script { - new buf[1024]; - new buffer[SLIDE_TEXT_MAX_LENGTH]; - get_text(PART:"elm.text", buf, 1024); - snprintf(buffer, SLIDE_TEXT_MAX_LENGTH, "%s", buf); - strcat(buffer, SLIDE_TEXT_CHAR_GAP); - strcat(buffer, buf); - strcat(buffer, SLIDE_TEXT_CHAR_GAP); - set_text(PART:"elm.text.slide", buffer); - } - } - program { "on_start_slide"; - script { - run_program(PROGRAM:"stop_slide"); - set_int(g_timer_id, timer(1.5, "start_slide", 0)); - } - } - program { "on_stop_slide"; - script { - stop_slide(); - } - } - } -} - -group { "elm/label/base/slide_short"; - inherit: "elm/label/base/template"; - script { - public g_duration = 0, g_stopslide, g_timer_id, g_anim_id; - - public message(Msg_Type:type, id, ...) { - if (type == MSG_FLOAT_SET) { - new Float:duration; - duration = getfarg(2); - if (id == 0) - set_float(g_duration, duration); - else - set_float(g_duration, duration / LABEL_FONT_SIZE_INC * SLIDE_SPEED_WEIGHT); - } - } - public slide_to_end_anim(val, Float:pos) { - new stopflag; - new id; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0); - if (pos >= 1.0) { - id = timer(0.5, "slide_to_begin", 1); - set_int(g_timer_id, id); - } - } - public slide_to_end() { - new stopflag; - new id; - new Float:duration; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - duration = get_float(g_duration); - id = anim(duration, "slide_to_end_anim", 1); - set_int(g_anim_id, id); - } - public slide_to_begin() { - new stopflag; - new id; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - set_state(PART:"elm.text", "slide_begin", 0.0); - id = timer(0.5, "slide_to_end", 1); - set_int(g_timer_id, id); - } - public start_slide() { - set_int(g_stopslide, 0); - set_state(PART:"elm.text", "slide_begin", 0.0); - slide_to_end(); - } - public stop_slide() { - new id; - set_int(g_stopslide, 1); - id = get_int(g_anim_id); - cancel_anim(id); - id = get_int(g_timer_id); - cancel_timer(id); - set_state(PART:"elm.text", "default", 0.0); - } - } - parts { - rect { "bg"; - desc { "default"; - color_class: "label/slide_short/bg"; - } - } - rect { "clipper"; - desc { "default"; - color_class: "label/slide_short/opacity"; - } - } - textblock { "elm.text"; - scale; - clip: "clipper"; - desc { "default"; - align: 0.0 0.0; - text { - style: "textblock_style"; - min: 0 1; - align: 0.0 0.0; - } - } - desc { "slide_end"; - inherit: "default"; - rel1.relative: 1.0 0.0; - align: 1.0 0.0; - text { - style: "textblock_style"; - min: 1 1; - align: 0.0 0.0; - } - } - desc { "slide_begin"; - inherit: "default"; - rel2.relative: 0.0 1.0; - align: 0.0 0.0; - text { - style: "textblock_style"; - min: 1 1; - align: 0.0 0.0; - } - } - } - } - programs { - program { "on_start_slide"; - script { - start_slide(); - } - } - program { "on_stop_slide"; - script { - stop_slide(); - } - } - } -} - -group { "elm/label/base/slide_bounce"; - inherit: "elm/label/base/template"; - script { - public g_duration = 0, g_stopslide, g_timer_id, g_anim_id; - - public message(Msg_Type:type, id, ...) { - if (type == MSG_FLOAT_SET) { - new Float:duration; - duration = getfarg(2); - if (id == 0) - set_float(g_duration, duration); - else - set_float(g_duration, duration / LABEL_FONT_SIZE_INC * SLIDE_SPEED_WEIGHT); - } - } - public slide_to_end_anim(val, Float:pos) { - new stopflag; - new id; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0); - if (pos >= 1.0) { - id = timer(0.5, "slide_to_begin", 1); - set_int(g_timer_id, id); - } - } - public slide_to_end() { - new stopflag; - new id; - new Float:duration; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - duration = get_float(g_duration); - id = anim(duration, "slide_to_end_anim", 1); - set_int(g_anim_id, id); - } - public slide_to_begin_anim(val, Float:pos) { - new stopflag; - new id; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - set_tween_state(PART:"elm.text", pos, "slide_end", 0.0, "slide_begin", 0.0); - if (pos >= 1.0) { - id = timer(0.5, "slide_to_end", 1); - set_int(g_timer_id, id); - } - } - public slide_to_begin() { - new stopflag; - new id; - new Float:duration; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - duration = get_float(g_duration); - id = anim(duration, "slide_to_begin_anim", 1); - set_int(g_anim_id, id); - } - public start_slide() { - set_int(g_stopslide, 0); - set_state(PART:"elm.text", "slide_begin", 0.0); - slide_to_end(); - } - public stop_slide() { - new id; - set_int(g_stopslide, 1); - id = get_int(g_anim_id); - cancel_anim(id); - id = get_int(g_timer_id); - cancel_timer(id); - set_state(PART:"elm.text", "default", 0.0); - } - } - parts { - rect { "bg"; - desc { "default"; - color_class: "label/slide_bounce/bg"; - } - } - rect { "clipper"; - desc { "default"; - color_class: "label/slide_bounce/opacity"; - } - } - textblock { "elm.text"; - scale; - clip: "clipper"; - desc { "default"; - align: 0.0 0.0; - text { - style: "textblock_style"; - min: 0 1; - align: 0.0 0.0; - } - } - desc { "slide_end"; - inherit: "default"; - rel1.relative: 1.0 0.0; - align: 1.0 0.0; - text.min: 1 1; - } - desc { "slide_begin"; - inherit: "default"; - rel2.relative: 0.0 1.0; - text.min: 1 1; - } - } - } - programs { - program { "on_start_slide"; - script { - start_slide(); - } - } - program { "on_stop_slide"; - script { - stop_slide(); - } - } - } -} |