summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWonki Kim <wonki_.kim@samsung.com>2017-01-18 04:05:04 (GMT)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2017-04-11 09:38:50 (GMT)
commitefb723e0ebb30795ca27143a5121ed3762a2199b (patch)
treedf6b2334abcbda940d039b7fea161c90a68fd86d
parent350ef0a3a796e185643a82d6c896ab5aa661d272 (diff)
downloadefl-theme-tizen-mobile-efb723e0ebb30795ca27143a5121ed3762a2199b.zip
efl-theme-tizen-mobile-efb723e0ebb30795ca27143a5121ed3762a2199b.tar.gz
efl-theme-tizen-mobile-efb723e0ebb30795ca27143a5121ed3762a2199b.tar.bz2
scroller: Add fixed property into overscroll effectrefs/changes/51/124451/2
Once overscroll effect part don't have fixed property, size of scroller will be affected by min size of overscroll effect part. Change-Id: I309799b91e68a95ba58fe0e92868e72a416e5cbd Signed-off-by: Wonki Kim <wonki_.kim@samsung.com>
-rw-r--r--mobile/widgets/scroller.edc415
1 files changed, 415 insertions, 0 deletions
diff --git a/mobile/widgets/scroller.edc b/mobile/widgets/scroller.edc
index 27f68bf..73991f9 100644
--- a/mobile/widgets/scroller.edc
+++ b/mobile/widgets/scroller.edc
@@ -1439,6 +1439,421 @@ group { "elm/scroller/base/effect";
alias: "elm/gengrid/base/default";
alias: "elm/scroller/base/popup/no_inset_shadow";
inherit: "elm/scroller/base/default";
+
+ // Macro
+#define SCROLL_EDGE_MOUSE_DOWN_PROGRAM(_dir) \
+ program { "edge_"#_dir"_mouse_down"; \
+ signal: "elm,state,mouse,down"; \
+ source: "elm"; \
+ script { \
+ set_int(effect_##_dir##_down, 1); \
+ } \
+ }
+
+#define SCROLL_EDGE_MOUSE_UP_PROGRAM(_dir) \
+ program { "edge_"#_dir"_mouse_up"; \
+ signal: "elm,state,mouse,up"; \
+ source: "elm"; \
+ script { \
+ set_int(effect_##_dir##_down, 0); \
+ if (get_int(effect_##_dir##_start)) \
+ { \
+ set_int(effect_##_dir##_reset, 0); \
+ if (!get_int(effect_##_dir##_anim)) \
+ { \
+ if (!get_int(effect_##_dir##_end)) \
+ { \
+ set_int(effect_##_dir##_end, 1); \
+ run_program(PROGRAM:"edge_"#_dir"_end"); \
+ } \
+ } \
+ } \
+ } \
+ }
+
+#define SCROLL_EDGE_SCROLL_PROGRAM(_dir) \
+ program { "edge_"#_dir"_scroll"; \
+ signal: "elm,action,scroll"; \
+ source: "elm"; \
+ script { \
+ if (get_int(effect_##_dir##_start)) \
+ { \
+ set_state(PART:"shadow_"#_dir"1", "default", 0.0); \
+ set_state(PART:"spacer_"#_dir"1", "default", 0.0); \
+ set_state(PART:"shadow_"#_dir"2", "default", 0.0); \
+ set_state(PART:"spacer_"#_dir"2", "default", 0.0); \
+ set_state(PART:"shadow_"#_dir"3", "default", 0.0); \
+ set_state(PART:"spacer_"#_dir"3", "default", 0.0); \
+ set_state(PART:"shadow_"#_dir"4", "default", 0.0); \
+ set_state(PART:"spacer_"#_dir"4", "default", 0.0); \
+ set_state(PART:"shadow_"#_dir"5", "default", 0.0); \
+ set_state(PART:"spacer_"#_dir"5", "default", 0.0); \
+ set_int(effect_##_dir##_reset, 0); \
+ run_program(PROGRAM:"edge_"#_dir"_init"); \
+ } \
+ } \
+ }
+
+#define SCROLL_EDGE_END_PROGRAM(_dir) \
+ program { "edge_"#_dir"_end"; \
+ action: STATE_SET "default"; \
+ target: "shadow_"#_dir"1"; \
+ target: "shadow_"#_dir"2"; \
+ target: "shadow_"#_dir"3"; \
+ target: "shadow_"#_dir"4"; \
+ target: "shadow_"#_dir"5"; \
+ transition: SINUSOIDAL 0.3; \
+ after: "edge_"#_dir"_init"; \
+ }
+
+#define SCROLL_EDGE_INIT_PROGRAM(_dir) \
+ program { "edge_"#_dir"_init"; \
+ script { \
+ set_int(effect_##_dir##_move, 0); \
+ if (!get_int(effect_##_dir##_reset)) \
+ set_int(effect_##_dir##_start, 0); \
+ set_int(effect_##_dir##_max, 0); \
+ set_int(_dir##_prev_diff, 0); \
+ set_int(effect_##_dir##_end, 0); \
+ set_state(PART:"spacer_"#_dir"1", "default", 0.0); \
+ set_state(PART:"spacer_"#_dir"2", "default", 0.0); \
+ set_state(PART:"spacer_"#_dir"3", "default", 0.0); \
+ set_state(PART:"spacer_"#_dir"4", "default", 0.0); \
+ set_state(PART:"spacer_"#_dir"5", "default", 0.0); \
+ } \
+ }
+#define SCROLL_EDGE_PROGRAM(_dir) \
+ program { "edge_"#_dir; \
+ signal: "elm,edge,"#_dir; \
+ source: "elm"; \
+ script { \
+ if (!get_int(effect_##_dir##_start)) \
+ { \
+ set_int(effect_##_dir##_start, 1); \
+ set_int(effect_##_dir##_anim, 1); \
+ run_program(PROGRAM:"edge_"#_dir"_start"); \
+ } \
+ } \
+ }
+
+#define SCROLL_EDGE_START_PROGRAM(_dir) \
+ program { "edge_"#_dir"_start"; \
+ action: STATE_SET "start"; \
+ target: "shadow_"#_dir"1"; \
+ target: "shadow_"#_dir"2"; \
+ target: "shadow_"#_dir"3"; \
+ target: "shadow_"#_dir"4"; \
+ target: "shadow_"#_dir"5"; \
+ transition: SINUSOIDAL 0.2; \
+ after: "edge_"#_dir"_after"; \
+ }
+
+#define SCROLL_EDGE_AFTER_PROGRAM(_dir) \
+ program { "edge_"#_dir"_after"; \
+ script { \
+ new xx, yy; \
+ get_mouse(xx, yy); \
+ set_int(_dir##_down_x, xx); \
+ set_int(_dir##_down_y, yy); \
+ set_int(effect_##_dir##_anim, 0); \
+ if (get_int(effect_##_dir##_down)) \
+ { \
+ set_int(effect_##_dir##_move, 1); \
+ } \
+ else \
+ { \
+ set_int(effect_##_dir##_reset, 0); \
+ if (!get_int(effect_##_dir##_end)) \
+ { \
+ set_int(effect_##_dir##_end, 1); \
+ run_program(PROGRAM:"edge_"#_dir"_end"); \
+ } \
+ } \
+ } \
+ }
+
+#define SCROLL_EDGE_MOUSE_MOVE_PROGRAM_DIFF_VERNOR(_dir) \
+ set_int(_dir##_diff, (get_int(_dir##_move_y) - get_int(_dir##_down_y)));
+
+#define SCROLL_EDGE_MOUSE_MOVE_PROGRAM_DIFF_VERREV(_dir) \
+ set_int(_dir##_diff, (get_int(_dir##_down_y) - get_int(_dir##_move_y)));
+
+#define SCROLL_EDGE_MOUSE_MOVE_PROGRAM_DIFF_HORNOR(_dir) \
+ set_int(_dir##_diff, (get_int(_dir##_move_x) - get_int(_dir##_down_x)));
+
+#define SCROLL_EDGE_MOUSE_MOVE_PROGRAM_DIFF_HORREV(_dir) \
+ set_int(_dir##_diff, (get_int(_dir##_down_x) - get_int(_dir##_move_x)));
+
+#define SCROLL_EDGE_MOUSE_MOVE_PROGRAM_STATE_VER(_dir) \
+ custom_state(PART:"spacer_"#_dir"1", "default", 0.0); \
+ set_state_val(PART:"spacer_"#_dir"1", STATE_MIN, 0, round(fx1)); \
+ set_state_val(PART:"spacer_"#_dir"1", STATE_MAX, -1, round(fx1)); \
+ set_state(PART:"spacer_"#_dir"1", "custom", 0.0); \
+ custom_state(PART:"spacer_"#_dir"2", "default", 0.0); \
+ set_state_val(PART:"spacer_"#_dir"2", STATE_MIN, 0, round(fx2)); \
+ set_state_val(PART:"spacer_"#_dir"2", STATE_MAX, -1, round(fx2)); \
+ set_state(PART:"spacer_"#_dir"2", "custom", 0.0); \
+ custom_state(PART:"spacer_"#_dir"3", "default", 0.0); \
+ set_state_val(PART:"spacer_"#_dir"3", STATE_MIN, 0, round(fx3)); \
+ set_state_val(PART:"spacer_"#_dir"3", STATE_MAX, -1, round(fx3)); \
+ set_state(PART:"spacer_"#_dir"3", "custom", 0.0); \
+ custom_state(PART:"spacer_"#_dir"4", "default", 0.0); \
+ set_state_val(PART:"spacer_"#_dir"4", STATE_MIN, 0, round(fx4)); \
+ set_state_val(PART:"spacer_"#_dir"4", STATE_MAX, -1, round(fx4)); \
+ set_state(PART:"spacer_"#_dir"4", "custom", 0.0); \
+ custom_state(PART:"spacer_"#_dir"5", "default", 0.0); \
+ set_state_val(PART:"spacer_"#_dir"5", STATE_MIN, 0, round(fx5)); \
+ set_state_val(PART:"spacer_"#_dir"5", STATE_MAX, -1, round(fx5)); \
+ set_state(PART:"spacer_"#_dir"5", "custom", 0.0); \
+ set_int(_dir##_prev_diff, get_int(_dir##_diff));
+
+#define SCROLL_EDGE_MOUSE_MOVE_PROGRAM_STATE_HOR(_dir) \
+ custom_state(PART:"spacer_"#_dir"1", "default", 0.0); \
+ set_state_val(PART:"spacer_"#_dir"1", STATE_MIN, round(fx1), 0); \
+ set_state_val(PART:"spacer_"#_dir"1", STATE_MAX, round(fx1), -1); \
+ set_state(PART:"spacer_"#_dir"1", "custom", 0.0); \
+ custom_state(PART:"spacer_"#_dir"2", "default", 0.0); \
+ set_state_val(PART:"spacer_"#_dir"2", STATE_MIN, round(fx2), 0); \
+ set_state_val(PART:"spacer_"#_dir"2", STATE_MAX, round(fx2), -1); \
+ set_state(PART:"spacer_"#_dir"2", "custom", 0.0); \
+ custom_state(PART:"spacer_"#_dir"3", "default", 0.0); \
+ set_state_val(PART:"spacer_"#_dir"3", STATE_MIN, round(fx3), 0); \
+ set_state_val(PART:"spacer_"#_dir"3", STATE_MAX, round(fx3), -1); \
+ set_state(PART:"spacer_"#_dir"3", "custom", 0.0); \
+ custom_state(PART:"spacer_"#_dir"4", "default", 0.0); \
+ set_state_val(PART:"spacer_"#_dir"4", STATE_MIN, round(fx4), 0); \
+ set_state_val(PART:"spacer_"#_dir"4", STATE_MAX, round(fx4), -1); \
+ set_state(PART:"spacer_"#_dir"4", "custom", 0.0); \
+ custom_state(PART:"spacer_"#_dir"5", "default", 0.0); \
+ set_state_val(PART:"spacer_"#_dir"5", STATE_MIN, round(fx5), 0); \
+ set_state_val(PART:"spacer_"#_dir"5", STATE_MAX, round(fx5), -1); \
+ set_state(PART:"spacer_"#_dir"5", "custom", 0.0); \
+ set_int(_dir##_prev_diff, get_int(_dir##_diff));
+
+#define SCROLL_EDGE_MOUSE_MOVE_PROGRAM(_dir, _hor, _rev) \
+ program { "edge_"#_dir"_mouse_move"; \
+ signal: "elm,state,mouse,move"; \
+ source: "elm"; \
+ script { \
+ if (get_int(effect_##_dir##_move)) \
+ { \
+ new xx, yy; \
+ new Float:fx1, Float:fx2, Float:fx3, Float:fx4, Float:fx5; \
+ get_mouse(xx, yy); \
+ set_int(_dir##_move_x, xx); \
+ set_int(_dir##_move_y, yy); \
+ SCROLL_EDGE_MOUSE_MOVE_PROGRAM_DIFF_##_hor##_rev(_dir) \
+ if (get_int(_dir##_diff) < get_int(_dir##_prev_diff)) \
+ { \
+ set_int(_dir##_prev_diff, 0); \
+ set_int(effect_##_dir##_move, 0); \
+ set_int(effect_##_dir##_reset, 1); \
+ if (!get_int(effect_##_dir##_end)) \
+ { \
+ set_int(effect_##_dir##_end, 1); \
+ run_program(PROGRAM:"edge_"#_dir"_end"); \
+ } \
+ } \
+ else \
+ { \
+ if (!get_int(effect_##_dir##_end)) \
+ { \
+ if (get_int(_dir##_diff) <= 90 && !get_int(effect_##_dir##_max)) \
+ { \
+ fx1 = fx2 = fx3 = fx4 = fx5 = sin(get_int(_dir##_diff), DEGREES); \
+ fx1 = fx1 * SCROLLER_EFFECT_SHADOW_FIRST_LAYER_MOVE_CORRECTION_VALUE + SCROLLER_EFFECT_SHADOW_FIRST_LAYER_MIN_SIZE; \
+ fx2 = fx2 * SCROLLER_EFFECT_SHADOW_SECOND_LAYER_MOVE_CORRECTION_VALUE + SCROLLER_EFFECT_SHADOW_SECOND_LAYER_MIN_SIZE; \
+ fx3 = fx3 * SCROLLER_EFFECT_SHADOW_THIRD_LAYER_MOVE_CORRECTION_VALUE + SCROLLER_EFFECT_SHADOW_THIRD_LAYER_MIN_SIZE; \
+ fx4 = fx4 * SCROLLER_EFFECT_SHADOW_FOURTH_LAYER_MOVE_CORRECTION_VALUE + SCROLLER_EFFECT_SHADOW_FOURTH_LAYER_MIN_SIZE; \
+ fx5 = fx5 * SCROLLER_EFFECT_SHADOW_FIFTH_LAYER_MOVE_CORRECTION_VALUE + SCROLLER_EFFECT_SHADOW_FIFTH_LAYER_MIN_SIZE; \
+ } \
+ else \
+ { \
+ set_int(effect_##_dir##_max, 1); \
+ fx1 = SCROLLER_EFFECT_SHADOW_FIRST_LAYER_MAX_SIZE; \
+ fx2 = SCROLLER_EFFECT_SHADOW_SECOND_LAYER_MAX_SIZE; \
+ fx3 = SCROLLER_EFFECT_SHADOW_THIRD_LAYER_MAX_SIZE; \
+ fx4 = SCROLLER_EFFECT_SHADOW_FOURTH_LAYER_MAX_SIZE; \
+ fx5 = SCROLLER_EFFECT_SHADOW_FIFTH_LAYER_MAX_SIZE; \
+ } \
+ SCROLL_EDGE_MOUSE_MOVE_PROGRAM_STATE_##_hor(_dir) \
+ } \
+ } \
+ } \
+ } \
+ }
+
+#define SHADOW_PART_SPACER_top(_dir, _num, _NUM) \
+ spacer { "spacer_top"#_num; \
+ scale; \
+ desc { "default"; \
+ rel1.relative: 0.0 0.0; \
+ rel1.to: "bg"; \
+ rel2.relative: 1.0 0.0; \
+ rel2.to: "bg"; \
+ align: 0.5 0.0; \
+ min: 0 SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MIN_SIZE; \
+ max: -1 SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MIN_SIZE; \
+ fixed: 0 1; \
+ } \
+ }
+
+#define SHADOW_PART_SPACER_bottom(_dir, _num, _NUM) \
+ spacer { "spacer_bottom"#_num; \
+ scale; \
+ desc { "default"; \
+ rel1.relative: 0.0 1.0; \
+ rel1.to: "bg"; \
+ rel2.relative: 1.0 1.0; \
+ rel2.to: "bg"; \
+ align: 0.5 1.0; \
+ min: 0 SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MIN_SIZE; \
+ max: -1 SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MIN_SIZE; \
+ fixed: 0 1; \
+ } \
+ }
+
+#define SHADOW_PART_SPACER_left(_dir, _num, _NUM) \
+ spacer { "spacer_left"#_num; \
+ scale; \
+ desc { "default"; \
+ rel1.relative: 0.0 0.0; \
+ rel1.to: "bg"; \
+ rel2.relative: 0.0 1.0; \
+ rel2.to: "bg"; \
+ align: 0.0 0.5; \
+ min: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MIN_SIZE 0; \
+ max: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MIN_SIZE -1; \
+ fixed: 1 0; \
+ } \
+ }
+#define SHADOW_PART_SPACER_right(_dir, _num, _NUM) \
+ spacer { "spacer_right"#_num; \
+ scale; \
+ desc { "default"; \
+ rel1.relative: 1.0 0.0; \
+ rel1.to: "bg"; \
+ rel2.relative: 1.0 1.0; \
+ rel2.to: "bg"; \
+ align: 1.0 0.5; \
+ min: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MIN_SIZE 0; \
+ max: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MIN_SIZE -1; \
+ fixed: 1 0; \
+ } \
+ }
+#define SHADOW_PART_RECT_top(_dir, _num, _NUM) \
+ rect { "shadow_top"#_num; \
+ clip: "clipper"; \
+ scale; \
+ desc { "default"; \
+ rel1.relative: 0.0 0.0; \
+ rel1.to: "bg"; \
+ rel2.relative: 1.0 0.0; \
+ rel2.to: "bg"; \
+ align: 0.5 1.0; \
+ min: 0 SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MAX_SIZE; \
+ max: -1 SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MAX_SIZE; \
+ color_class: "scroller/default/end_effect"; \
+ fixed: 0 1; \
+ } \
+ desc { "start"; \
+ inherit: "default"; \
+ rel1.relative: 0.0 1.0; \
+ rel1.to: "spacer_top"#_num; \
+ rel2.relative: 1.0 1.0; \
+ rel2.to: "spacer_top"#_num; \
+ align: 0.5 1.0; \
+ } \
+ }
+#define SHADOW_PART_RECT_bottom(_dir, _num, _NUM) \
+ rect { "shadow_bottom"#_num; \
+ clip: "clipper"; \
+ scale; \
+ desc { "default"; \
+ rel1.relative: 0.0 1.0; \
+ rel1.to: "bg"; \
+ rel2.relative: 1.0 1.0; \
+ rel2.to: "bg"; \
+ align: 0.5 0.0; \
+ min: 0 SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MAX_SIZE; \
+ max: -1 SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MAX_SIZE; \
+ color_class: "scroller/default/end_effect"; \
+ fixed: 0 1; \
+ } \
+ desc { "start"; \
+ inherit: "default"; \
+ rel1.relative: 0.0 0.0; \
+ rel1.to: "spacer_bottom"#_num; \
+ rel2.relative: 1.0 0.0; \
+ rel2.to: "spacer_bottom"#_num; \
+ align: 0.5 0.0; \
+ } \
+ }
+
+#define SHADOW_PART_RECT_left(_dir, _num, _NUM) \
+ rect { "shadow_left"#_num; \
+ clip: "clipper"; \
+ scale; \
+ desc { "default"; \
+ rel1.relative: 0.0 0.0; \
+ rel1.to: "bg"; \
+ rel2.relative: 0.0 1.0; \
+ rel2.to: "bg"; \
+ rel2.offset: -1 -1; \
+ align: 1.0 0.5; \
+ min: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MAX_SIZE 0; \
+ max: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MAX_SIZE -1; \
+ color_class: "scroller/default/end_effect"; \
+ fixed: 1 0; \
+ } \
+ desc { "start"; \
+ inherit: "default"; \
+ rel1.relative: 1.0 0.0; \
+ rel1.to: "spacer_left"#_num; \
+ rel2.relative: 1.0 1.0; \
+ rel2.to: "spacer_left"#_num; \
+ align: 1.0 0.5; \
+ } \
+ }
+
+#define SHADOW_PART_RECT_right(_dir, _num, _NUM) \
+ rect { "shadow_right"#_num; \
+ clip: "clipper"; \
+ scale; \
+ desc { "default"; \
+ rel1.relative: 1.0 0.0; \
+ rel1.to: "bg"; \
+ rel2.relative: 1.0 1.0; \
+ rel2.to: "bg"; \
+ rel2.offset: -1 -1; \
+ align: 0.0 0.5; \
+ min: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MAX_SIZE 0; \
+ max: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MAX_SIZE -1; \
+ color_class: "scroller/default/end_effect"; \
+ fixed: 1 0; \
+ } \
+ desc { "start"; \
+ inherit: "default"; \
+ rel1.relative: 0.0 0.0; \
+ rel1.to: "spacer_right"#_num; \
+ rel2.relative: 0.0 1.0; \
+ rel2.to: "spacer_right"#_num; \
+ align: 0.0 0.5; \
+ } \
+ }
+
+#define SHADOW_PART_LAYER(_dir, _num, _NUM) \
+ SHADOW_PART_SPACER_##_dir(_dir, _num, _NUM) \
+ SHADOW_PART_RECT_##_dir(_dir, _num, _NUM)
+
+#define SHADOW_PART(_dir) \
+ SHADOW_PART_LAYER(_dir, 1, FIRST) \
+ SHADOW_PART_LAYER(_dir, 2, SECOND) \
+ SHADOW_PART_LAYER(_dir, 3, THIRD) \
+ SHADOW_PART_LAYER(_dir, 4, FOURTH) \
+ SHADOW_PART_LAYER(_dir, 5, FIFTH)
+ // Macro END
+
parts {
rect { "shadow_top1";
clip: "clipper";