summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungbok Shin <youngb.shin@samsung.com>2017-08-02 05:21:18 (GMT)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>2017-08-04 05:48:14 (GMT)
commit1fe76f4edee5dc821541a001e1a57604e9572152 (patch)
tree644a27f943c4927c59cb643339cab0278e7198cd
parent97bba1b8b4526bb2c93a5b1202d2ac065e68f14e (diff)
downloadefl-theme-tizen-mobile-1fe76f4edee5dc821541a001e1a57604e9572152.zip
efl-theme-tizen-mobile-1fe76f4edee5dc821541a001e1a57604e9572152.tar.gz
efl-theme-tizen-mobile-1fe76f4edee5dc821541a001e1a57604e9572152.tar.bz2
label: apply text.ellipsize.marquee for slide_long, slide_roll stylesrefs/changes/39/141939/2
It also adds a slide feature for default style. Change-Id: Ibb1e9c670384870452dc3101290c1af9d1be6b90
-rw-r--r--mobile/widgets/label.edc275
1 files changed, 60 insertions, 215 deletions
diff --git a/mobile/widgets/label.edc b/mobile/widgets/label.edc
index e8dbf2a..09ddbfc 100644
--- a/mobile/widgets/label.edc
+++ b/mobile/widgets/label.edc
@@ -69,6 +69,24 @@ group { "elm/label/event/default";
signal: "elm,state,slide,stop";
after: "on_stop_slide";
}
+ program { "marquee_loop";
+ signal: "text,ellipsize,marquee,loop";
+ source: "elm.text";
+ action: SIGNAL_EMIT "elm,state,slide,end" "elm";
+ after: "on_marquee_loop";
+ }
+ program { "marquee_done";
+ signal: "text,ellipsize,marquee,done";
+ source: "elm.text";
+ action: SIGNAL_EMIT "elm,state,slide,done" "elm";
+ after: "on_marquee_done";
+ }
+ program { "marquee_none";
+ signal: "text,ellipsize,marquee,none";
+ source: "elm.text";
+ action: SIGNAL_EMIT "elm,state,slide,none" "elm";
+ after: "on_marquee_none";
+ }
}
}
@@ -93,6 +111,12 @@ group { "elm/label/base/template";
}
program { "on_stop_slide";
}
+ program { "on_marquee_loop";
+ }
+ program { "on_marquee_done";
+ }
+ program { "on_marquee_none";
+ }
}
}
@@ -126,6 +150,14 @@ group { "elm/label/base/default";
fixed: 1 0;
text.min: 0 1;
}
+ desc { "marquee";
+ inherit: "horizontal_fixed";
+ text {
+ ellipsize {
+ mode: MARQUEE;
+ }
+ }
+ }
}
}
programs {
@@ -139,6 +171,14 @@ group { "elm/label/base/default";
action: STATE_SET "horizontal_fixed";
target: "elm.text";
}
+ program { "on_start_slide";
+ action: STATE_SET "marquee";
+ target: "elm.text";
+ }
+ program { "on_stop_slide";
+ action: STATE_SET "horizontal_fixed";
+ target: "elm.text";
+ }
}
}
@@ -282,64 +322,6 @@ group { "elm/label/base_wrap/marker";
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 { "clipper";
desc { "default";
@@ -364,120 +346,31 @@ group { "elm/label/base/slide_long";
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";
+ desc { "marquee";
inherit: "default";
- rel1.relative: 1.0 0.0;
text {
- style: "textblock_style";
- min: 1 1;
- align: 0.0 0.0;
+ ellipsize {
+ mode: MARQUEE;
+ }
}
}
}
}
programs {
program { "on_start_slide";
- script {
- start_slide();
- }
+ action: STATE_SET "marquee";
+ target: "elm.text";
}
program { "on_stop_slide";
- script {
- stop_slide();
- }
+ action: STATE_SET "default";
+ target: "elm.text";
}
}
}
+
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 { "clipper";
desc { "default";
@@ -515,75 +408,27 @@ group { "elm/label/base/slide_roll";
inherit: "default";
text.min: 1 1;
}
- }
- rect { "clipper_elm.text.slide";
- nomouse;
- clip: "clipper";
- desc { "default";
- hid;
- }
- desc { "show";
+ desc { "marquee";
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;
+ ellipsize {
+ mode: MARQUEE;
+ marquee {
+ type: ROLL;
+ }
+ }
}
}
- 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));
- }
+ action: STATE_SET "marquee";
+ target: "elm.text";
}
program { "on_stop_slide";
- script {
- stop_slide();
- }
+ action: STATE_SET "default";
+ target: "elm.text";
}
}
}