diff options
author | Hosang Kim <hosang12.kim@samsung.com> | 2017-07-11 16:25:44 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-07-11 16:34:14 +0900 |
commit | f41e2761608fff7b070d630a73848908c6be5e5b (patch) | |
tree | cf47583270aa7434147084985dcc43b8930f1462 /src/lib/edje/edje_calc.c | |
parent | e8b35c779e7d7bba86172d00612fe08abee6c920 (diff) |
slider: Allow range limitations
Summary:
When user drags slider, slider value cannot be changed by API.
However the necessity of above behavior has emerged.
Because sometimes applications want limitation of slider value.
Test Plan: elementary_test -> slider -> Limited
Reviewers: woohyun, cedric, SanghyeonLee, singh.amitesh, jpeg
Reviewed By: jpeg
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4883
Diffstat (limited to '')
-rw-r--r-- | src/lib/edje/edje_calc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index fdae32a975..1bad0321cc 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c | |||
@@ -1072,6 +1072,7 @@ _edje_part_dragable_calc(Edje *ed EINA_UNUSED, Edje_Real_Part *ep, FLOAT_T *x, F | |||
1072 | void | 1072 | void |
1073 | _edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T x, FLOAT_T y) | 1073 | _edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T x, FLOAT_T y) |
1074 | { | 1074 | { |
1075 | Evas_Coord ex = 0, ey = 0; | ||
1075 | /* check whether this part is dragable at all */ | 1076 | /* check whether this part is dragable at all */ |
1076 | if (!ep->drag) return; | 1077 | if (!ep->drag) return; |
1077 | 1078 | ||
@@ -1080,8 +1081,12 @@ _edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T x, FLOAT_T y) | |||
1080 | * value we would set foo to, because it would depend on the | 1081 | * value we would set foo to, because it would depend on the |
1081 | * size of the dragable... | 1082 | * size of the dragable... |
1082 | */ | 1083 | */ |
1084 | evas_object_geometry_get(ep->object, &ex, &ey, NULL, NULL); | ||
1085 | |||
1083 | if (NEQ(ep->drag->x, x) || ep->drag->tmp.x) | 1086 | if (NEQ(ep->drag->x, x) || ep->drag->tmp.x) |
1084 | { | 1087 | { |
1088 | if (ep->drag->down.count > 0) | ||
1089 | ep->drag->down.x = ex; | ||
1085 | ep->drag->x = x; | 1090 | ep->drag->x = x; |
1086 | ep->drag->tmp.x = 0; | 1091 | ep->drag->tmp.x = 0; |
1087 | ep->drag->need_reset = 0; | 1092 | ep->drag->need_reset = 0; |
@@ -1091,6 +1096,8 @@ _edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T x, FLOAT_T y) | |||
1091 | 1096 | ||
1092 | if (NEQ(ep->drag->y, y) || ep->drag->tmp.y) | 1097 | if (NEQ(ep->drag->y, y) || ep->drag->tmp.y) |
1093 | { | 1098 | { |
1099 | if (ep->drag->down.count > 0) | ||
1100 | ep->drag->down.y = ey; | ||
1094 | ep->drag->y = y; | 1101 | ep->drag->y = y; |
1095 | ep->drag->tmp.y = 0; | 1102 | ep->drag->tmp.y = 0; |
1096 | ep->drag->need_reset = 0; | 1103 | ep->drag->need_reset = 0; |
@@ -5157,7 +5164,9 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
5157 | dy = ZERO; | 5164 | dy = ZERO; |
5158 | _edje_part_dragable_calc(ed, ep, &dx, &dy); | 5165 | _edje_part_dragable_calc(ed, ep, &dx, &dy); |
5159 | ep->drag->x = dx; | 5166 | ep->drag->x = dx; |
5167 | ep->drag->val.x = dx; | ||
5160 | ep->drag->y = dy; | 5168 | ep->drag->y = dy; |
5169 | ep->drag->val.y = dy; | ||
5161 | ep->drag->tmp.x = 0; | 5170 | ep->drag->tmp.x = 0; |
5162 | ep->drag->tmp.y = 0; | 5171 | ep->drag->tmp.y = 0; |
5163 | ep->drag->need_reset = 0; | 5172 | ep->drag->need_reset = 0; |