summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--NEWS2
-rw-r--r--config/default/base.src1
-rw-r--r--config/mobile/base.src1
-rw-r--r--config/standard/base.src1
-rw-r--r--src/bin/config.c53
-rw-r--r--src/lib/elm_config.c16
-rw-r--r--src/lib/elm_config.h23
-rw-r--r--src/lib/elm_interface_scrollable.c18
-rw-r--r--src/lib/elm_priv.h1
10 files changed, 118 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 969bb5d1f..88d211ffd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1482,3 +1482,8 @@
1482 1482
1483 * added callback call "scroll", "scroll,anim,start", "scroll,anim,stop", "scroll,drag,start", "scroll,drag,stop" 1483 * added callback call "scroll", "scroll,anim,start", "scroll,anim,stop", "scroll,drag,start", "scroll,drag,stop"
1484 in toolar widget. 1484 in toolar widget.
1485
14862013-07-03 Jaehwan Kim
1487
1488 * Change the method to calculate a distance which be scrolled from linear to sine curve.
1489 And add the configuration thumbscroll_flick_distance_tolerance. It's the max flick distance.
diff --git a/NEWS b/NEWS
index d2e771b3d..fb6563f26 100644
--- a/NEWS
+++ b/NEWS
@@ -78,6 +78,7 @@ Additions:
78 * Add elm_fileselector_mime_type_filter_append and elm_fileselector_filters_clear to support mime type filter. 78 * Add elm_fileselector_mime_type_filter_append and elm_fileselector_filters_clear to support mime type filter.
79 * Add the elm_scrollable_interface_content_viewport_resize_cb_set. 79 * Add the elm_scrollable_interface_content_viewport_resize_cb_set.
80 * added callback call "scroll", "scroll,anim,start", "scroll,anim,stop", "scroll,drag,start", "scroll,drag,stop" in toolar widget. 80 * added callback call "scroll", "scroll,anim,start", "scroll,anim,stop", "scroll,drag,start", "scroll,drag,stop" in toolar widget.
81 * Add the configuration thumbscroll_flick_distance_tolerance.
81 82
82Improvements: 83Improvements:
83 84
@@ -119,6 +120,7 @@ Improvements:
119 * Support language change for widget items (Ctxpopup, Hoversel, Naviframe, Diskselector, List, Menu, Segment_Control, Toolbar, Popup, MultibuttonEntry) 120 * Support language change for widget items (Ctxpopup, Hoversel, Naviframe, Diskselector, List, Menu, Segment_Control, Toolbar, Popup, MultibuttonEntry)
120 * Move cursor when mouse moves with longpress. 121 * Move cursor when mouse moves with longpress.
121 * Show magnifier when selection handlers are pressed or moved. 122 * Show magnifier when selection handlers are pressed or moved.
123 * Change the method to calculate a distance which be scrolled from linear to sine curve.
122 124
123Fixes: 125Fixes:
124 * Now elm_datetime_field_limit_set() can set year limits wihtout problems. 126 * Now elm_datetime_field_limit_set() can set year limits wihtout problems.
diff --git a/config/default/base.src b/config/default/base.src
index 445a3cd09..db8595649 100644
--- a/config/default/base.src
+++ b/config/default/base.src
@@ -6,6 +6,7 @@ group "Elm_Config" struct {
6 value "thumbscroll_threshold" int: 24; 6 value "thumbscroll_threshold" int: 24;
7 value "thumbscroll_hold_threshold" int: 24; 7 value "thumbscroll_hold_threshold" int: 24;
8 value "thumbscroll_momentum_threshold" double: 100.0; 8 value "thumbscroll_momentum_threshold" double: 100.0;
9 value "thumbscroll_flick_distance_tolerance" int: 1000;
9 value "thumbscroll_friction" double: 1.0; 10 value "thumbscroll_friction" double: 1.0;
10 value "thumbscroll_min_friction" double: 1.0; 11 value "thumbscroll_min_friction" double: 1.0;
11 value "thumbscroll_friction_standard" double: 2000.0; 12 value "thumbscroll_friction_standard" double: 2000.0;
diff --git a/config/mobile/base.src b/config/mobile/base.src
index a3453cec6..2b4057777 100644
--- a/config/mobile/base.src
+++ b/config/mobile/base.src
@@ -6,6 +6,7 @@ group "Elm_Config" struct {
6 value "thumbscroll_threshold" int: 24; 6 value "thumbscroll_threshold" int: 24;
7 value "thumbscroll_hold_threshold" int: 100; 7 value "thumbscroll_hold_threshold" int: 100;
8 value "thumbscroll_momentum_threshold" double: 100.0; 8 value "thumbscroll_momentum_threshold" double: 100.0;
9 value "thumbscroll_flick_distance_tolerance" int: 1000;
9 value "thumbscroll_friction" double: 1.0; 10 value "thumbscroll_friction" double: 1.0;
10 value "thumbscroll_min_friction" double: 0.3; 11 value "thumbscroll_min_friction" double: 0.3;
11 value "thumbscroll_friction_standard" double: 3000.0; 12 value "thumbscroll_friction_standard" double: 3000.0;
diff --git a/config/standard/base.src b/config/standard/base.src
index e15968989..c5a0f488c 100644
--- a/config/standard/base.src
+++ b/config/standard/base.src
@@ -6,6 +6,7 @@ group "Elm_Config" struct {
6 value "thumbscroll_threshold" int: 4; 6 value "thumbscroll_threshold" int: 4;
7 value "thumbscroll_hold_threshold" int: 4; 7 value "thumbscroll_hold_threshold" int: 4;
8 value "thumbscroll_momentum_threshold" double: 100.0; 8 value "thumbscroll_momentum_threshold" double: 100.0;
9 value "thumbscroll_flick_distance_tolerance" int: 1000;
9 value "thumbscroll_friction" double: 1.0; 10 value "thumbscroll_friction" double: 1.0;
10 value "thumbscroll_min_friction" double: 1.0; 11 value "thumbscroll_min_friction" double: 1.0;
11 value "thumbscroll_friction_standard" double: 2000.0; 12 value "thumbscroll_friction_standard" double: 2000.0;
diff --git a/src/bin/config.c b/src/bin/config.c
index 6c3520f07..4f37d9df1 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -347,6 +347,31 @@ tsmt_change(void *data __UNUSED__,
347} 347}
348 348
349static void 349static void
350tsfdt_round(void *data __UNUSED__,
351 Evas_Object *obj,
352 void *event_info __UNUSED__)
353{
354 double val = elm_slider_value_get(obj);
355 double v;
356
357 v = ((double)((int)(val * 10.0))) / 10.0;
358 if (v != val) elm_slider_value_set(obj, v);
359}
360
361static void
362tsfdt_change(void *data __UNUSED__,
363 Evas_Object *obj,
364 void *event_info __UNUSED__)
365{
366 double tsfdt = elm_config_scroll_thumbscroll_flick_distance_tolerance_get();
367 double val = elm_slider_value_get(obj);
368
369 if (tsfdt == val) return;
370 elm_config_scroll_thumbscroll_flick_distance_tolerance_set(val);
371 elm_config_all_flush();
372}
373
374static void
350tsf_round(void *data __UNUSED__, 375tsf_round(void *data __UNUSED__,
351 Evas_Object *obj, 376 Evas_Object *obj,
352 void *event_info __UNUSED__) 377 void *event_info __UNUSED__)
@@ -1122,7 +1147,8 @@ _config_display_update(Evas_Object *win)
1122{ 1147{
1123 int flush_interval, font_c, image_c, edje_file_c, edje_col_c, ts_threshould, 1148 int flush_interval, font_c, image_c, edje_file_c, edje_col_c, ts_threshould,
1124 ts_hold_threshold; 1149 ts_hold_threshold;
1125 double scale, s_bounce_friction, ts_momentum_threshold, ts_friction, 1150 double scale, s_bounce_friction, ts_momentum_threshold,
1151 ts_flick_distance_tolerance, ts_friction,
1126 ts_min_friction, ts_friction_standard, ts_border_friction, 1152 ts_min_friction, ts_friction_standard, ts_border_friction,
1127 ts_sensitivity_friction, ts_acceleration_threshold, 1153 ts_sensitivity_friction, ts_acceleration_threshold,
1128 ts_acceleration_time_limit, ts_acceleration_weight, page_friction, 1154 ts_acceleration_time_limit, ts_acceleration_weight, page_friction,
@@ -1148,6 +1174,7 @@ _config_display_update(Evas_Object *win)
1148 ts_threshould = elm_config_scroll_thumbscroll_threshold_get(); 1174 ts_threshould = elm_config_scroll_thumbscroll_threshold_get();
1149 ts_hold_threshold = elm_config_scroll_thumbscroll_hold_threshold_get(); 1175 ts_hold_threshold = elm_config_scroll_thumbscroll_hold_threshold_get();
1150 ts_momentum_threshold = elm_config_scroll_thumbscroll_momentum_threshold_get(); 1176 ts_momentum_threshold = elm_config_scroll_thumbscroll_momentum_threshold_get();
1177 ts_flick_distance_tolerance = elm_config_scroll_thumbscroll_flick_distance_tolerance_get();
1151 ts_friction = elm_config_scroll_thumbscroll_friction_get(); 1178 ts_friction = elm_config_scroll_thumbscroll_friction_get();
1152 ts_min_friction = elm_config_scroll_thumbscroll_min_friction_get(); 1179 ts_min_friction = elm_config_scroll_thumbscroll_min_friction_get();
1153 ts_friction_standard = elm_config_scroll_thumbscroll_friction_standard_get(); 1180 ts_friction_standard = elm_config_scroll_thumbscroll_friction_standard_get();
@@ -1192,6 +1219,9 @@ _config_display_update(Evas_Object *win)
1192 "ts_momentum_threshold_slider"), 1219 "ts_momentum_threshold_slider"),
1193 ts_momentum_threshold); 1220 ts_momentum_threshold);
1194 elm_slider_value_set(evas_object_data_get(win, 1221 elm_slider_value_set(evas_object_data_get(win,
1222 "ts_flick_distance_tolerance_slider"),
1223 ts_flick_distance_tolerance);
1224 elm_slider_value_set(evas_object_data_get(win,
1195 "ts_friction_slider"), 1225 "ts_friction_slider"),
1196 ts_friction); 1226 ts_friction);
1197 elm_slider_value_set(evas_object_data_get(win, 1227 elm_slider_value_set(evas_object_data_get(win,
@@ -2888,6 +2918,27 @@ _status_config_scrolling(Evas_Object *win,
2888 evas_object_smart_callback_add(sl, "delay,changed", tsmt_change, 2918 evas_object_smart_callback_add(sl, "delay,changed", tsmt_change,
2889 NULL); 2919 NULL);
2890 2920
2921 LABEL_FRAME_ADD("<hilight>Thumb scroll flick distance tolerance</>");
2922
2923 sl = elm_slider_add(win);
2924 elm_object_tooltip_text_set(sl, "This is the number of pixels the maximum<br/>"
2925 "distance which can be flicked. If it is<br/>"
2926 "flicked more than this, the flick distance<br/>"
2927 "is same with maximum distance");
2928 evas_object_data_set(win, "ts_flick_distance_tolerance_slider", sl);
2929 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2930 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2931 elm_slider_span_size_set(sl, 120);
2932 elm_slider_unit_format_set(sl, "%1.0f pixels");
2933 elm_slider_indicator_format_set(sl, "%1.0f");
2934 elm_slider_min_max_set(sl, 100.0, 3000.0);
2935 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_flick_distance_tolerance_get());
2936 elm_box_pack_end(bx, sl);
2937 evas_object_show(sl);
2938
2939 evas_object_smart_callback_add(sl, "changed", tsfdt_round, NULL);
2940 evas_object_smart_callback_add(sl, "delay,changed", tsfdt_change, NULL);
2941
2891 LABEL_FRAME_ADD("<hilight>Thumb scroll friction</>"); 2942 LABEL_FRAME_ADD("<hilight>Thumb scroll friction</>");
2892 2943
2893 sl = elm_slider_add(win); 2944 sl = elm_slider_add(win);
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index 022028504..f158f2d24 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -342,6 +342,7 @@ _desc_init(void)
342 ELM_CONFIG_VAL(D, T, thumbscroll_threshold, T_INT); 342 ELM_CONFIG_VAL(D, T, thumbscroll_threshold, T_INT);
343 ELM_CONFIG_VAL(D, T, thumbscroll_hold_threshold, T_INT); 343 ELM_CONFIG_VAL(D, T, thumbscroll_hold_threshold, T_INT);
344 ELM_CONFIG_VAL(D, T, thumbscroll_momentum_threshold, T_DOUBLE); 344 ELM_CONFIG_VAL(D, T, thumbscroll_momentum_threshold, T_DOUBLE);
345 ELM_CONFIG_VAL(D, T, thumbscroll_flick_distance_tolerance, T_INT);
345 ELM_CONFIG_VAL(D, T, thumbscroll_friction, T_DOUBLE); 346 ELM_CONFIG_VAL(D, T, thumbscroll_friction, T_DOUBLE);
346 ELM_CONFIG_VAL(D, T, thumbscroll_min_friction, T_DOUBLE); 347 ELM_CONFIG_VAL(D, T, thumbscroll_min_friction, T_DOUBLE);
347 ELM_CONFIG_VAL(D, T, thumbscroll_friction_standard, T_DOUBLE); 348 ELM_CONFIG_VAL(D, T, thumbscroll_friction_standard, T_DOUBLE);
@@ -1085,6 +1086,7 @@ _config_load(void)
1085 _elm_config->thumbscroll_threshold = 24; 1086 _elm_config->thumbscroll_threshold = 24;
1086 _elm_config->thumbscroll_hold_threshold = 24; 1087 _elm_config->thumbscroll_hold_threshold = 24;
1087 _elm_config->thumbscroll_momentum_threshold = 100.0; 1088 _elm_config->thumbscroll_momentum_threshold = 100.0;
1089 _elm_config->thumbscroll_flick_distance_tolerance = 1000;
1088 _elm_config->thumbscroll_friction = 1.0; 1090 _elm_config->thumbscroll_friction = 1.0;
1089 _elm_config->thumbscroll_min_friction = 0.5; 1091 _elm_config->thumbscroll_min_friction = 0.5;
1090 _elm_config->thumbscroll_friction_standard = 1000.0; 1092 _elm_config->thumbscroll_friction_standard = 1000.0;
@@ -1507,6 +1509,8 @@ _env_get(void)
1507 // FIXME: floatformat locale issues here 1.0 vs 1,0 - should just be 1.0 1509 // FIXME: floatformat locale issues here 1.0 vs 1,0 - should just be 1.0
1508 s = getenv("ELM_THUMBSCROLL_MOMENTUM_THRESHOLD"); 1510 s = getenv("ELM_THUMBSCROLL_MOMENTUM_THRESHOLD");
1509 if (s) _elm_config->thumbscroll_momentum_threshold = _elm_atof(s); 1511 if (s) _elm_config->thumbscroll_momentum_threshold = _elm_atof(s);
1512 s = getenv("ELM_THUMBSCROLL_FLICK_DISTANCE_TOLERANCE");
1513 if (s) _elm_config->thumbscroll_flick_distance_tolerance = atoi(s);
1510 s = getenv("ELM_THUMBSCROLL_FRICTION"); 1514 s = getenv("ELM_THUMBSCROLL_FRICTION");
1511 if (s) _elm_config->thumbscroll_friction = _elm_atof(s); 1515 if (s) _elm_config->thumbscroll_friction = _elm_atof(s);
1512 s = getenv("ELM_THUMBSCROLL_MIN_FRICTION"); 1516 s = getenv("ELM_THUMBSCROLL_MIN_FRICTION");
@@ -2182,6 +2186,18 @@ elm_config_scroll_thumbscroll_momentum_threshold_set(double threshold)
2182 _elm_config->thumbscroll_momentum_threshold = threshold; 2186 _elm_config->thumbscroll_momentum_threshold = threshold;
2183} 2187}
2184 2188
2189EAPI unsigned int
2190elm_config_scroll_thumbscroll_flick_distance_tolerance_get(void)
2191{
2192 return _elm_config->thumbscroll_flick_distance_tolerance;
2193}
2194
2195EAPI void
2196elm_config_scroll_thumbscroll_flick_distance_tolerance_set(unsigned int distance)
2197{
2198 _elm_config->thumbscroll_flick_distance_tolerance = distance;
2199}
2200
2185EAPI double 2201EAPI double
2186elm_config_scroll_thumbscroll_friction_get(void) 2202elm_config_scroll_thumbscroll_friction_get(void)
2187{ 2203{
diff --git a/src/lib/elm_config.h b/src/lib/elm_config.h
index b9e38fc2e..6f1bd25b6 100644
--- a/src/lib/elm_config.h
+++ b/src/lib/elm_config.h
@@ -350,6 +350,29 @@ EAPI double elm_config_scroll_thumbscroll_momentum_threshold_get(void);
350EAPI void elm_config_scroll_thumbscroll_momentum_threshold_set(double threshold); 350EAPI void elm_config_scroll_thumbscroll_momentum_threshold_set(double threshold);
351 351
352/** 352/**
353 * Get the number of pixels the maximum distance which can be flicked.
354 * If it is flicked more than this,
355 * the flick distance is same with maximum distance.
356 *
357 * @return the thumb scroll maximum flick distance
358 *
359 * @ingroup Scrolling
360 */
361EAPI unsigned int elm_config_scroll_thumbscroll_flick_distance_tolerance_get(void);
362
363/**
364 * Set the number of pixels the maximum distance which can be flicked.
365 * If it is flicked more than this,
366 * the flick distance is same with maximum distance.
367 *
368 * @param distance the thumb scroll maximum flick distance
369 *
370 * @see elm_config_thumbscroll_flick_distance_tolerance_get()
371 * @ingroup Scrolling
372 */
373EAPI void elm_config_scroll_thumbscroll_flick_distance_tolerance_set(unsigned int distance);
374
375/**
353 * Get the amount of inertia a scroller will impose at self scrolling 376 * Get the amount of inertia a scroller will impose at self scrolling
354 * animations. 377 * animations.
355 * 378 *
diff --git a/src/lib/elm_interface_scrollable.c b/src/lib/elm_interface_scrollable.c
index 1aeb02923..69e3025d0 100644
--- a/src/lib/elm_interface_scrollable.c
+++ b/src/lib/elm_interface_scrollable.c
@@ -2400,6 +2400,7 @@ _elm_scroll_mouse_up_event_cb(void *data,
2400 if ((_elm_config->thumbscroll_friction > 0.0) && 2400 if ((_elm_config->thumbscroll_friction > 0.0) &&
2401 (vel > _elm_config->thumbscroll_momentum_threshold)) 2401 (vel > _elm_config->thumbscroll_momentum_threshold))
2402 { 2402 {
2403 Evas_Coord vw, vh, max_d;
2403 int minx, miny, mx, my, px, py; 2404 int minx, miny, mx, my, px, py;
2404 double tt = 0.0, dtt = 0.0; 2405 double tt = 0.0, dtt = 0.0;
2405 2406
@@ -2408,8 +2409,21 @@ _elm_scroll_mouse_up_event_cb(void *data,
2408 eo_do(sid->pan_obj, elm_obj_pan_pos_max_get 2409 eo_do(sid->pan_obj, elm_obj_pan_pos_max_get
2409 (&mx, &my)); 2410 (&mx, &my));
2410 eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py)); 2411 eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py));
2411 sid->down.dx = ((double)dx / at); 2412 eo_do(sid->obj,
2412 sid->down.dy = ((double)dy / at); 2413 elm_scrollable_interface_content_viewport_size_get(&vw, &vh));
2414 max_d = _elm_config->thumbscroll_flick_distance_tolerance;
2415 if (dx > 0)
2416 sid->down.dx = (sin((M_PI * (double)dx / max_d)
2417 - (M_PI / 2)) + 1) * max_d / at;
2418 else
2419 sid->down.dx = (sin((M_PI * (double)dx / max_d)
2420 + (M_PI / 2)) - 1) * max_d / at;
2421 if (dy > 0)
2422 sid->down.dy = (sin((M_PI * (double)dy / max_d)
2423 - (M_PI / 2)) + 1) * max_d / at;
2424 else
2425 sid->down.dy = (sin((M_PI * (double)dy / max_d)
2426 + (M_PI / 2)) - 1) * max_d / at;
2413 if (((sid->down.dx > 0) && (sid->down.pdx > 0)) || 2427 if (((sid->down.dx > 0) && (sid->down.pdx > 0)) ||
2414 ((sid->down.dx < 0) && (sid->down.pdx < 0)) || 2428 ((sid->down.dx < 0) && (sid->down.pdx < 0)) ||
2415 ((sid->down.dy > 0) && (sid->down.pdy > 0)) || 2429 ((sid->down.dy > 0) && (sid->down.pdy > 0)) ||
diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h
index 6100b6f03..cd473467c 100644
--- a/src/lib/elm_priv.h
+++ b/src/lib/elm_priv.h
@@ -161,6 +161,7 @@ struct _Elm_Config
161 int thumbscroll_threshold; 161 int thumbscroll_threshold;
162 int thumbscroll_hold_threshold; 162 int thumbscroll_hold_threshold;
163 double thumbscroll_momentum_threshold; 163 double thumbscroll_momentum_threshold;
164 int thumbscroll_flick_distance_tolerance;
164 double thumbscroll_friction; 165 double thumbscroll_friction;
165 double thumbscroll_min_friction; 166 double thumbscroll_min_friction;
166 double thumbscroll_friction_standard; 167 double thumbscroll_friction_standard;