summaryrefslogtreecommitdiff
path: root/src/lib/elm_spinner.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elm_spinner.c')
-rw-r--r--src/lib/elm_spinner.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c
index 9624380a6..654e1a67a 100644
--- a/src/lib/elm_spinner.c
+++ b/src/lib/elm_spinner.c
@@ -217,11 +217,18 @@ _drag_cb(void *data,
217 else 217 else
218 eo_do((Eo *)wd->resize_obj, 218 eo_do((Eo *)wd->resize_obj,
219 edje_obj_part_drag_value_get("elm.dragable.slider", &pos, NULL)); 219 edje_obj_part_drag_value_get("elm.dragable.slider", &pos, NULL));
220 if (sd->drag_prev_pos != 0)
221 sd->drag_val_step = pow((pos - sd->drag_prev_pos), 2);
222 else
223 sd->drag_val_step = 1;
224
220 225
221 delta = pos * sd->step * _elm_config->scale; 226 delta = sd->drag_val_step * sd->step * _elm_config->scale;
227 if (pos < sd->drag_prev_pos) delta *= -1;
228 sd->drag_prev_pos = pos;
222 /* If we are on rtl mode, change the delta to be negative on such changes */ 229 /* If we are on rtl mode, change the delta to be negative on such changes */
223 if (elm_widget_mirrored_get(obj)) delta *= -1; 230 if (elm_widget_mirrored_get(obj)) delta *= -1;
224 if (_value_set(data, sd->drag_start_val + delta)) _label_write(data); 231 if (_value_set(data, sd->val + delta)) _label_write(data);
225 sd->dragging = 1; 232 sd->dragging = 1;
226} 233}
227 234
@@ -233,7 +240,8 @@ _drag_start_cb(void *data,
233{ 240{
234 ELM_SPINNER_DATA_GET(data, sd); 241 ELM_SPINNER_DATA_GET(data, sd);
235 242
236 sd->drag_start_val = sd->val; 243 sd->drag_prev_pos = 0;
244 sd->drag_val_step = 1;
237 245
238 evas_object_smart_callback_call(obj, SIG_DRAG_START, NULL); 246 evas_object_smart_callback_call(obj, SIG_DRAG_START, NULL);
239} 247}
@@ -247,7 +255,8 @@ _drag_stop_cb(void *data,
247 ELM_SPINNER_DATA_GET(data, sd); 255 ELM_SPINNER_DATA_GET(data, sd);
248 ELM_WIDGET_DATA_GET_OR_RETURN(data, wd); 256 ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
249 257
250 sd->drag_start_val = 0; 258 sd->drag_prev_pos = 0;
259 sd->drag_val_step = 1;
251 edje_object_part_drag_value_set 260 edje_object_part_drag_value_set
252 (wd->resize_obj, "elm.dragable.slider", 0.0, 0.0); 261 (wd->resize_obj, "elm.dragable.slider", 0.0, 0.0);
253 262