summaryrefslogtreecommitdiff
path: root/mobile/widgets/flipselector.edc
diff options
context:
space:
mode:
authorChunEon Park <chuneon.park@samsung.com>2015-05-06 09:36:02 +0900
committerGerrit Code Review <gerrit@tizensrc>2015-05-06 09:36:02 +0900
commit699aa3efc83535239e9037493d198615f4e9e12f (patch)
tree89e695ab845d11659ad4fe9fd6dbaece472a2ae6 /mobile/widgets/flipselector.edc
parent78d4573bf778a3178c8398ecddaa66b3bf07e43e (diff)
parent2b818435fb0c4aad19fd050df8f993166938ae96 (diff)
downloadefl-theme-tizen-mobile-699aa3efc83535239e9037493d198615f4e9e12f.tar.gz
efl-theme-tizen-mobile-699aa3efc83535239e9037493d198615f4e9e12f.tar.bz2
efl-theme-tizen-mobile-699aa3efc83535239e9037493d198615f4e9e12f.zip
Merge "[flipselector] Add theme for flipselector widget." into tizen_2.4_qHD
Diffstat (limited to 'mobile/widgets/flipselector.edc')
-rw-r--r--mobile/widgets/flipselector.edc496
1 files changed, 496 insertions, 0 deletions
diff --git a/mobile/widgets/flipselector.edc b/mobile/widgets/flipselector.edc
new file mode 100644
index 00000000..ef1326e8
--- /dev/null
+++ b/mobile/widgets/flipselector.edc
@@ -0,0 +1,496 @@
+#define FLIP_PICKER_MAX_LEN (3)
+#define FLIP_PICKER_MAX_LEN_STR "3"
+
+group { name: "elm/flipselector/base/default";
+ images.image: "core_picker_up.png" COMP;
+ images.image: "core_picker_up_bg.png" COMP;
+ images.image: "core_picker_down.png" COMP;
+ images.image: "core_picker_arrow_up.png" COMP;
+ images.image: "core_picker_arrow_down.png" COMP;
+
+ data.item: "max_len" FLIP_PICKER_MAX_LEN_STR;
+
+ //FIXME: quick successive clicks on, say, up, lead to nastiness
+ script {
+ public cur, prev, next, lock;
+
+ flip_up(str[]) {
+ new tmp[FLIP_PICKER_MAX_LEN];
+ if (get_int(lock) == 1) {
+ replace_str(next, 0, str);
+ return;
+ }
+ fetch_str(cur, 0, tmp, FLIP_PICKER_MAX_LEN);
+
+ set_text(PART:"bottom_text_prev", tmp);
+ set_state(PART:"elm.top", "shrink", 0.0);
+ set_text(PART:"elm.top", tmp);
+ set_state(PART:"elm.top", "default", 0.0);
+ set_text(PART:"elm.top", tmp);
+
+ replace_str(prev, 0, tmp);
+
+ set_state(PART:"elm.bottom", "default", 0.0);
+ set_text(PART:"elm.bottom", str);
+ set_state(PART:"elm.bottom", "shrink", 0.0);
+ set_text(PART:"elm.bottom", str);
+ set_text(PART:"top_text_prev", str);
+
+ replace_str(cur, 0, str);
+
+ set_state(PART:"bottom_prev", "default", 0.0);
+ set_state(PART:"top_prev", "shrink", 0.0);
+
+ set_int(lock, 1);
+ anim(0.2, "animator_top_down", 1);
+ }
+ flip_dn(str[]) {
+ new tmp[FLIP_PICKER_MAX_LEN];
+ if (get_int(lock) == 1) {
+ replace_str(next, 0, str);
+ return;
+ }
+
+ fetch_str(cur, 0, tmp, FLIP_PICKER_MAX_LEN);
+
+ set_text(PART:"top_text_prev", tmp);
+ set_state(PART:"elm.bottom", "shrink", 0.0);
+ set_text(PART:"elm.bottom", tmp);
+ set_state(PART:"elm.bottom", "default", 0.0);
+ set_text(PART:"elm.bottom", tmp);
+
+ replace_str(prev, 0, tmp);
+
+ set_state(PART:"elm.top", "default", 0.0);
+ set_text(PART:"elm.top", str);
+ set_state(PART:"elm.top", "shrink", 0.0);
+ set_text(PART:"elm.top", str);
+ set_text(PART:"bottom_text_prev", str);
+
+ replace_str(cur, 0, str);
+
+ set_state(PART:"bottom_prev", "shrink", 0.0);
+ set_state(PART:"top_prev", "default", 0.0);
+
+ set_int(lock, 1);
+ anim(0.2, "animator_bottom_up", 1);
+ }
+ public animator_bottom_down(val, Float:pos) {
+ new tmp[FLIP_PICKER_MAX_LEN];
+
+ set_tween_state(PART:"elm.bottom", pos, "shrink", 0.0, "default", 0.0);
+ set_tween_state(PART:"bottom_prev", pos, "default", 0.0, "shrink", 0.0);
+
+ if (pos >= 1.0) {
+ set_int(lock, 0);
+ fetch_str(next, 0, tmp, FLIP_PICKER_MAX_LEN);
+ if (strncmp(tmp, "", FLIP_PICKER_MAX_LEN) != 0) {
+ replace_str(next, 0, "");
+ flip_up(tmp);
+ }
+ }
+ }
+ public animator_top_down(val, Float:pos) {
+ set_tween_state(PART:"elm.top", pos, "default", 0.0, "shrink", 0.0);
+ set_tween_state(PART:"top_prev", pos, "shrink", 0.0, "default", 0.0);
+ if (pos >= 1.0)
+ {
+ anim(0.2, "animator_bottom_down", val);
+ }
+ }
+ public animator_bottom_up(val, Float:pos) {
+ set_tween_state(PART:"elm.bottom", pos, "default", 0.0, "shrink", 0.0);
+ set_tween_state(PART:"bottom_prev", pos, "shrink", 0.0, "default", 0.0);
+
+ if (pos >= 1.0) anim(0.2, "animator_top_up", val);
+ }
+ public animator_top_up(val, Float:pos) {
+ new tmp[FLIP_PICKER_MAX_LEN];
+
+ set_tween_state(PART:"elm.top", pos, "shrink", 0.0, "default", 0.0);
+ set_tween_state(PART:"top_prev", pos, "default", 0.0, "shrink", 0.0);
+
+ if (pos >= 1.0) {
+ set_int(lock, 0);
+
+ fetch_str(next, 0, tmp, FLIP_PICKER_MAX_LEN);
+ if (strncmp(tmp, "", FLIP_PICKER_MAX_LEN) != 0) {
+ replace_str(next, 0, "");
+ flip_dn(tmp);
+ }
+ }
+ }
+ public message(Msg_Type:type, id, ...) {
+ /* flip down */
+ if ((type == MSG_STRING) && (id == 1)) {
+ new value[FLIP_PICKER_MAX_LEN];
+ snprintf(value, FLIP_PICKER_MAX_LEN, "%s", getarg(2));
+ flip_up(value);
+ /* flip up */
+ } else if ((type == MSG_STRING) && (id == 2)) {
+ new value[FLIP_PICKER_MAX_LEN];
+ snprintf(value, FLIP_PICKER_MAX_LEN, "%s", getarg(2));
+ flip_dn(value);
+ }
+ }
+ }
+ parts {
+ part { name: "base"; type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: FLIPSELECTOR_BASE_SIZE_INC;
+ max: FLIPSELECTOR_BASE_SIZE_INC;
+ }
+ }
+ part { name: "bottom"; type: IMAGE;
+ description { state: "default" 0.0;
+ min: FLIPSELECTOR_BOTTOM_SIZE_INC;
+ align: 0.5 1.0;
+ fixed: 0 1;
+ rel1 { to: "base"; relative: 0.0 1.0; }
+ rel2.to: "base";
+ image.normal: "core_picker_down.png";
+ color: 0 0 0 38;
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "top_bg"; type: IMAGE;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "top";
+ rel2.to: "top";
+ image.normal: "core_picker_up_bg.png";
+ color: 0 0 0 38;
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "top"; type: IMAGE;
+ description { state: "default" 0.0;
+ min: FLIPSELECTOR_TOP_SIZE_INC;
+ align: 0.5 0.0;
+ fixed: 0 1;
+ rel1.to: "base";
+ rel2 { to: "base"; relative: 1.0 0.0; }
+ image.normal: "core_picker_up.png";
+ color: 0 0 0 38;
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "divider";
+ type: RECT;
+ description { state: "default" 0.0;
+ min: FLIPSELECTOR_DIVIDER_SIZE_INC;
+ align: 0.5 0.0;
+ fixed: 0 1;
+ rel1.to: "top";
+ rel1.relative: 0.0 1.0;
+ rel2.to: "top";
+ color: 0 0 0 38;
+ }
+ }
+ part { name: "bottom_text_prev"; type: TEXT; mouse_events: 0;
+ clip_to: "bottom_prev";
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "divider";
+ rel2.to: "divider";
+ rel2.relative: 1.0 0.0;
+ text { font: "Tizen:style=Regular"; size: 108;
+ min: 1 1;
+ ellipsis: -1;
+ align: 0.5 0.5;
+ }
+ color: 0 0 0 255;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 0 0 0 127;
+ }
+ }
+ part { name: "bottom_prev"; type: RECT; mouse_events: 0;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "divider";
+ rel2.to: "bottom";
+ color: 255 255 255 255;
+ }
+ description { state: "shrink" 0.0;
+ inherit: "default" 0.0;
+ rel1.to: "bottom";
+ rel1.relative: 0.0 1.0;
+ }
+ }
+ part { name: "elm.bottom"; type: TEXT; mouse_events: 0;
+ clip_to: "bottom_clipper";
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "divider";
+ rel2.to: "divider";
+ rel2.relative: 1.0 0.0;
+ text { font: "Tizen:style=Regular"; size: 108;
+ min: 1 1;
+ ellipsis: -1;
+ align: 0.5 0.5;
+ }
+ color: 0 0 0 255;
+ }
+ description { state: "shrink" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 0 0 0 127;
+ }
+ }
+ part { name: "top_text_prev"; type: TEXT; mouse_events: 0;
+ clip_to: "top_prev";
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "divider";
+ rel2.to: "divider";
+ rel2.relative: 1.0 0.0;
+ text { font: "Tizen:style=Regular"; size: 108;
+ min: 1 1;
+ ellipsis: -1;
+ align: 0.5 0.5;
+ source: "elm.top";
+ }
+ color: 0 0 0 255;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 0 0 0 127;
+ }
+ }
+ part { name: "top_prev"; type: RECT; mouse_events: 0;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "top";
+ rel2.to: "divider";
+ color: 255 255 255 255;
+ }
+ description { state: "shrink" 0.0;
+ inherit: "default" 0.0;
+ rel2.to: "top";
+ rel2.relative: 1.0 0.0;
+ }
+ }
+ part { name: "elm.top"; type: TEXT; mouse_events: 0;
+ clip_to: "top_clipper";
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "divider";
+ rel2.to: "divider";
+ rel2.relative: 1.0 0.0;
+ text { font: "Tizen:style=Regular"; size: 108;
+ min: 1 1;
+ ellipsis: -1;
+ align: 0.5 0.5;
+ }
+ color: 0 0 0 255;
+ }
+ description { state: "shrink" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 0 0 0 127;
+ }
+ }
+ part { name: "arrow_top_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 0 1;
+ align: 0.5 0.0;
+ min: FLIPSELECTOR_ARROW_TOP_PADDING_SIZE_INC;
+ max: FLIPSELECTOR_ARROW_TOP_PADDING_SIZE_INC;
+ rel1.to: "top";
+ rel2.to: "top";
+ rel2.relative: 1.0 0.0;
+ }
+ }
+ part { name: "arrow_top"; mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: FLIPSELECTOR_ARROW_TOP_BOTTOM_SIZE_INC;
+ max: FLIPSELECTOR_ARROW_TOP_BOTTOM_SIZE_INC;
+ align: 0.5 0.0;
+ rel1.to: "arrow_top_padding";
+ rel1.relative: 0.0 1.0;
+ rel2.to: "arrow_top_padding";
+ image.normal: "core_picker_arrow_up.png";
+ color: 0 0 0 89;
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 0 0 0 38;
+ }
+ }
+ part { name: "arrow_bottom_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 0 1;
+ align: 0.5 1.0;
+ min: FLIPSELECTOR_ARROW_BOTTOM_PADDING_SIZE_INC;
+ max: FLIPSELECTOR_ARROW_BOTTOM_PADDING_SIZE_INC;
+ rel1.to: "bottom";
+ rel1.relative: 0.0 1.0;
+ rel2.to: "bottom";
+ }
+ }
+ part { name: "arrow_bottom"; mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: FLIPSELECTOR_ARROW_TOP_BOTTOM_SIZE_INC;
+ max: FLIPSELECTOR_ARROW_TOP_BOTTOM_SIZE_INC;
+ align: 0.5 1.0;
+ rel1.to: "arrow_bottom_padding";
+ rel2.to: "arrow_bottom_padding";
+ rel2.relative: 1.0 0.0;
+ image.normal: "core_picker_arrow_down.png";
+ color: 0 0 0 89;
+ }
+ description { state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 0 0 0 38;
+ }
+ }
+ part { name: "top_clipper"; type: RECT;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "top";
+ rel2.to: "divider";
+ }
+ }
+ part { name: "bottom_clipper"; type: RECT;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ rel1.to: "bottom";
+ rel2.to: "bottom";
+ }
+ }
+ part { name: "event_blocker"; type: RECT;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ color: 0 0 0 0;
+ visible: 0;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "load"; source: "";
+ script {
+ append_str(cur, "");
+ append_str(prev, "");
+ append_str(next, "");
+ set_int(lock, 0);
+ }
+ }
+ program {
+ signal: "elm,state,button,hidden"; source: "elm";
+ action: STATE_SET "hidden" 0.0;
+ target: "arrow_top";
+ target: "arrow_bottom";
+ target: "top";
+ target: "top_bg";
+ target: "bottom";
+ }
+ program {
+ signal: "elm,state,button,visible"; source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "arrow_top";
+ target: "arrow_bottom";
+ target: "top";
+ target: "top_bg";
+ target: "bottom";
+ }
+ program { name: "up";
+ signal: "mouse,down,1"; source: "top";
+ action: SIGNAL_EMIT "elm,action,up,start" "elm";
+ }
+ program { name: "up,stop";
+ signal: "mouse,up,1"; source: "top";
+ action: SIGNAL_EMIT "elm,action,up,stop" "elm";
+ }
+ program { name: "down";
+ signal: "mouse,down,1"; source: "bottom";
+ action: SIGNAL_EMIT "elm,action,down,start" "elm";
+ }
+ program { name: "down,stop";
+ signal: "mouse,up,1"; source: "bottom";
+ action: SIGNAL_EMIT "elm,action,down,stop" "elm";
+ }
+ program { name: "disable";
+ signal: "elm,state,disabled"; source: "elm";
+ script {
+ new st[31];
+ new Float:vl;
+ set_state(PART:"event_blocker", "disabled", 0.0);
+ set_state(PART:"elm.bottom", "disabled", 0.0);
+ set_state(PART:"elm.top", "disabled", 0.0);
+ set_state(PART:"bottom_text_prev", "disabled", 0.0);
+ set_state(PART:"top_text_prev", "disabled", 0.0);
+
+ get_state(PART:"arrow_bottom", st, 30, vl);
+ if (strcmp(st, "hidden"))
+ set_state(PART:"arrow_bottom", "disabled", 0.0);
+
+ get_state(PART:"arrow_top", st, 30, vl);
+ if (strcmp(st, "hidden"))
+ set_state(PART:"arrow_top", "disabled", 0.0);
+ }
+ }
+ program { name: "enable";
+ signal: "elm,state,enabled"; source: "elm";
+ script {
+ new st[31];
+ new Float:vl;
+ set_state(PART:"event_blocker", "default", 0.0);
+ set_state(PART:"elm.bottom", "default", 0.0);
+ set_state(PART:"elm.top", "default", 0.0);
+ set_state(PART:"bottom_text_prev", "default", 0.0);
+ set_state(PART:"top_text_prev", "default", 0.0);
+
+ get_state(PART:"arrow_bottom", st, 30, vl);
+ if (strcmp(st, "hidden"))
+ set_state(PART:"arrow_bottom", "default", 0.0);
+
+ get_state(PART:"arrow_top", st, 30, vl);
+ if (strcmp(st, "hidden"))
+ set_state(PART:"arrow_top", "default", 0.0);
+ }
+ }
+ }
+}