summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorJaehwan Kim <jae.hwan.kim@samsung.com>2013-04-30 16:46:59 +0900
committerJaehwan Kim <jae.hwan.kim@samsung.com>2013-04-30 16:48:18 +0900
commit0bde066596a87aa2db1fbb2d2ccf3e117929b941 (patch)
tree7e96d12416ff54164706a56a691d3946db1051b2 /legacy
parent1f82ec7a4a6b756c04694e8d5259642eeb44fa5d (diff)
Add the config elm_scroll_smooth_start_enable.
There's no tick when scroller starts scroll if it's set.
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/ChangeLog5
-rw-r--r--legacy/elementary/NEWS1
-rw-r--r--legacy/elementary/config/default/base.src1
-rw-r--r--legacy/elementary/config/mobile/base.src1
-rw-r--r--legacy/elementary/config/standard/base.src1
-rw-r--r--legacy/elementary/src/lib/elm_config.c4
-rw-r--r--legacy/elementary/src/lib/elm_interface_scrollable.c56
-rw-r--r--legacy/elementary/src/lib/elm_interface_scrollable.h1
-rw-r--r--legacy/elementary/src/lib/elm_priv.h1
9 files changed, 51 insertions, 20 deletions
diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog
index ef59b77065..fab69bdb62 100644
--- a/legacy/elementary/ChangeLog
+++ b/legacy/elementary/ChangeLog
@@ -1302,3 +1302,8 @@
13022013-04-29 ChunEon Park (Hermet) 13022013-04-29 ChunEon Park (Hermet)
1303 1303
1304 * Fix toolbar item clipped problem on reordering toolbar item. 1304 * Fix toolbar item clipped problem on reordering toolbar item.
1305
13062013-04-30 Jaehwan Kim
1307
1308 * Add the config elm_scroll_smooth_start_enable.
1309 There's no tick when scroller starts scroll if it's set.
diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS
index 76880ec2d4..6a1c4b63a5 100644
--- a/legacy/elementary/NEWS
+++ b/legacy/elementary/NEWS
@@ -64,6 +64,7 @@ Additions:
64 * Add elm_access_action(), elm_access_action_cb_set() 64 * Add elm_access_action(), elm_access_action_cb_set()
65 * Add elm_object_domain_part_text_translatable_set(), elm_object_item_domain_part_text_translatable_set(). 65 * Add elm_object_domain_part_text_translatable_set(), elm_object_item_domain_part_text_translatable_set().
66 * Support language,changed callback (Fileselector_Button, Fileselector Entry, Spinner. 66 * Support language,changed callback (Fileselector_Button, Fileselector Entry, Spinner.
67 * Add the config elm_scroll_smooth_start_enable.
67 68
68Improvements: 69Improvements:
69 70
diff --git a/legacy/elementary/config/default/base.src b/legacy/elementary/config/default/base.src
index 8177b3c1bb..3b396b67cb 100644
--- a/legacy/elementary/config/default/base.src
+++ b/legacy/elementary/config/default/base.src
@@ -17,6 +17,7 @@ group "Elm_Config" struct {
17 value "zoom_friction" double: 0.5; 17 value "zoom_friction" double: 0.5;
18 value "thumbscroll_border_friction" double: 0.5; 18 value "thumbscroll_border_friction" double: 0.5;
19 value "thumbscroll_sensitivity_friction" double: 0.25; 19 value "thumbscroll_sensitivity_friction" double: 0.25;
20 value "scroll_smooth_start_enable" uchar: 0;
20 value "scroll_smooth_time_interval" double: 0.0; 21 value "scroll_smooth_time_interval" double: 0.0;
21 value "scroll_smooth_amount" double: 0.0; 22 value "scroll_smooth_amount" double: 0.0;
22 value "scroll_smooth_history_weight" double: 0.1; 23 value "scroll_smooth_history_weight" double: 0.1;
diff --git a/legacy/elementary/config/mobile/base.src b/legacy/elementary/config/mobile/base.src
index 9037022cab..ea10161fc5 100644
--- a/legacy/elementary/config/mobile/base.src
+++ b/legacy/elementary/config/mobile/base.src
@@ -17,6 +17,7 @@ group "Elm_Config" struct {
17 value "zoom_friction" double: 0.5; 17 value "zoom_friction" double: 0.5;
18 value "thumbscroll_border_friction" double: 0.5; 18 value "thumbscroll_border_friction" double: 0.5;
19 value "thumbscroll_sensitivity_friction" double: 0.25; 19 value "thumbscroll_sensitivity_friction" double: 0.25;
20 value "scroll_smooth_start_enable" uchar: 1;
20 value "scroll_smooth_time_interval" double: 0; 21 value "scroll_smooth_time_interval" double: 0;
21 value "scroll_smooth_amount" double: 1.0; 22 value "scroll_smooth_amount" double: 1.0;
22 value "scroll_smooth_history_weight" double: 0.1; 23 value "scroll_smooth_history_weight" double: 0.1;
diff --git a/legacy/elementary/config/standard/base.src b/legacy/elementary/config/standard/base.src
index 8bd1a18276..65ea0801d7 100644
--- a/legacy/elementary/config/standard/base.src
+++ b/legacy/elementary/config/standard/base.src
@@ -17,6 +17,7 @@ group "Elm_Config" struct {
17 value "zoom_friction" double: 0.5; 17 value "zoom_friction" double: 0.5;
18 value "thumbscroll_border_friction" double: 0.5; 18 value "thumbscroll_border_friction" double: 0.5;
19 value "thumbscroll_sensitivity_friction" double: 0.25; 19 value "thumbscroll_sensitivity_friction" double: 0.25;
20 value "scroll_smooth_start_enable" uchar: 0;
20 value "scroll_smooth_time_interval" double: 0.0; 21 value "scroll_smooth_time_interval" double: 0.0;
21 value "scroll_smooth_amount" double: 0.0; 22 value "scroll_smooth_amount" double: 0.0;
22 value "scroll_smooth_history_weight" double: 0.1; 23 value "scroll_smooth_history_weight" double: 0.1;
diff --git a/legacy/elementary/src/lib/elm_config.c b/legacy/elementary/src/lib/elm_config.c
index 51ea0ee710..53eea72b17 100644
--- a/legacy/elementary/src/lib/elm_config.c
+++ b/legacy/elementary/src/lib/elm_config.c
@@ -364,6 +364,7 @@ _desc_init(void)
364 ELM_CONFIG_VAL(D, T, bring_in_scroll_friction, T_DOUBLE); 364 ELM_CONFIG_VAL(D, T, bring_in_scroll_friction, T_DOUBLE);
365 ELM_CONFIG_VAL(D, T, zoom_friction, T_DOUBLE); 365 ELM_CONFIG_VAL(D, T, zoom_friction, T_DOUBLE);
366 ELM_CONFIG_VAL(D, T, thumbscroll_bounce_enable, T_UCHAR); 366 ELM_CONFIG_VAL(D, T, thumbscroll_bounce_enable, T_UCHAR);
367 ELM_CONFIG_VAL(D, T, scroll_smooth_start_enable, T_UCHAR);
367 ELM_CONFIG_VAL(D, T, scroll_smooth_time_interval, T_DOUBLE); 368 ELM_CONFIG_VAL(D, T, scroll_smooth_time_interval, T_DOUBLE);
368 ELM_CONFIG_VAL(D, T, scroll_smooth_amount, T_DOUBLE); 369 ELM_CONFIG_VAL(D, T, scroll_smooth_amount, T_DOUBLE);
369 ELM_CONFIG_VAL(D, T, scroll_smooth_history_weight, T_DOUBLE); 370 ELM_CONFIG_VAL(D, T, scroll_smooth_history_weight, T_DOUBLE);
@@ -1073,6 +1074,7 @@ _config_load(void)
1073 _elm_config->zoom_friction = 0.5; 1074 _elm_config->zoom_friction = 0.5;
1074 _elm_config->thumbscroll_border_friction = 0.5; 1075 _elm_config->thumbscroll_border_friction = 0.5;
1075 _elm_config->thumbscroll_sensitivity_friction = 0.25; // magic number! just trial and error shows this makes it behave "nicer" and not run off at high speed all the time 1076 _elm_config->thumbscroll_sensitivity_friction = 0.25; // magic number! just trial and error shows this makes it behave "nicer" and not run off at high speed all the time
1077 _elm_config->scroll_smooth_start_enable = EINA_FALSE;
1076 _elm_config->scroll_smooth_time_interval = 0.008; 1078 _elm_config->scroll_smooth_time_interval = 0.008;
1077 _elm_config->scroll_smooth_amount = 1.0; 1079 _elm_config->scroll_smooth_amount = 1.0;
1078 _elm_config->scroll_smooth_history_weight = 0.3; 1080 _elm_config->scroll_smooth_history_weight = 0.3;
@@ -1521,6 +1523,8 @@ _env_get(void)
1521 1523
1522 _elm_config->thumbscroll_sensitivity_friction = friction; 1524 _elm_config->thumbscroll_sensitivity_friction = friction;
1523 } 1525 }
1526 s = getenv("ELM_SCROLL_SMOOTH_START_ENABLE");
1527 if (s) _elm_config->scroll_smooth_start_enable = !!atoi(s);
1524 s = getenv("ELM_SCROLL_SMOOTH_TIME_INTERVAL"); 1528 s = getenv("ELM_SCROLL_SMOOTH_TIME_INTERVAL");
1525 if (s) _elm_config->scroll_smooth_time_interval = atof(s); 1529 if (s) _elm_config->scroll_smooth_time_interval = atof(s);
1526 s = getenv("ELM_SCROLL_SMOOTH_AMOUNT"); 1530 s = getenv("ELM_SCROLL_SMOOTH_AMOUNT");
diff --git a/legacy/elementary/src/lib/elm_interface_scrollable.c b/legacy/elementary/src/lib/elm_interface_scrollable.c
index 7883027f49..e283f97fc2 100644
--- a/legacy/elementary/src/lib/elm_interface_scrollable.c
+++ b/legacy/elementary/src/lib/elm_interface_scrollable.c
@@ -2638,6 +2638,7 @@ _elm_scroll_mouse_down_event_cb(void *data,
2638#else 2638#else
2639 sid->down.history[0].timestamp = ecore_loop_time_get(); 2639 sid->down.history[0].timestamp = ecore_loop_time_get();
2640#endif 2640#endif
2641 sid->down.dragged_began_timestamp = sid->down.history[0].timestamp;
2641 sid->down.history[0].x = ev->canvas.x; 2642 sid->down.history[0].x = ev->canvas.x;
2642 sid->down.history[0].y = ev->canvas.y; 2643 sid->down.history[0].y = ev->canvas.y;
2643 } 2644 }
@@ -2817,27 +2818,31 @@ _elm_scroll_hold_animator(void *data)
2817 twin = _elm_config->scroll_smooth_time_window; 2818 twin = _elm_config->scroll_smooth_time_window;
2818 for (i = 0; i < 60; i++) 2819 for (i = 0; i < 60; i++)
2819 { 2820 {
2820 // oldest point is sd->down.history[i] 2821 if (sid->down.history[i].timestamp >
2821 // newset is sd->down.history[0] 2822 sid->down.dragged_began_timestamp)
2822 dt = t - sid->down.history[i].timestamp;
2823 if (dt > twin)
2824 { 2823 {
2825 i--; 2824 // oldest point is sd->down.history[i]
2826 break; 2825 // newset is sd->down.history[0]
2827 } 2826 dt = t - sid->down.history[i].timestamp;
2828 x = sid->down.history[i].x; 2827 if (dt > twin)
2829 y = sid->down.history[i].y; 2828 {
2830 _elm_scroll_down_coord_eval(sid, &x, &y); 2829 i--;
2831 if (i == 0) 2830 break;
2832 { 2831 }
2833 basex = x; 2832 x = sid->down.history[i].x;
2834 basey = y; 2833 y = sid->down.history[i].y;
2834 _elm_scroll_down_coord_eval(sid, &x, &y);
2835 if (i == 0)
2836 {
2837 basex = x;
2838 basey = y;
2839 }
2840 pos[i].x = x - basex;
2841 pos[i].y = y - basey;
2842 pos[i].t = sid->down.history[i].timestamp - sid->down.history[0].timestamp;
2843 count++;
2835 } 2844 }
2836 pos[i].x = x - basex; 2845 }
2837 pos[i].y = y - basey;
2838 pos[i].t = sid->down.history[i].timestamp - sid->down.history[0].timestamp;
2839 count++;
2840 }
2841 count = i; 2846 count = i;
2842 if (count >= 2) 2847 if (count >= 2)
2843 { 2848 {
@@ -3081,8 +3086,19 @@ _elm_scroll_mouse_move_event_cb(void *data,
3081 if ((sid->down.dragged) || 3086 if ((sid->down.dragged) ||
3082 (((x * x) + (y * y)) > 3087 (((x * x) + (y * y)) >
3083 (_elm_config->thumbscroll_threshold * 3088 (_elm_config->thumbscroll_threshold *
3084 _elm_config->thumbscroll_threshold))) 3089 _elm_config->thumbscroll_threshold)))
3085 { 3090 {
3091 if (!sid->down.dragged_began &&
3092 _elm_config->scroll_smooth_start_enable)
3093 {
3094 sid->down.x = ev->cur.canvas.x;
3095 sid->down.y = ev->cur.canvas.y;
3096#ifdef EVTIME
3097 sid->down.dragged_began_timestamp = ev->timestamp / 1000.0;
3098#else
3099 sid->down.dragged_began_timestamp = ecore_loop_time_get();
3100#endif
3101 }
3086 sid->down.dragged_began = EINA_TRUE; 3102 sid->down.dragged_began = EINA_TRUE;
3087 if (!sid->down.dragged) 3103 if (!sid->down.dragged)
3088 { 3104 {
diff --git a/legacy/elementary/src/lib/elm_interface_scrollable.h b/legacy/elementary/src/lib/elm_interface_scrollable.h
index 48d987137a..bee2229d70 100644
--- a/legacy/elementary/src/lib/elm_interface_scrollable.h
+++ b/legacy/elementary/src/lib/elm_interface_scrollable.h
@@ -1001,6 +1001,7 @@ struct _Elm_Scrollable_Smart_Interface_Data
1001 double est_timestamp_diff; 1001 double est_timestamp_diff;
1002 } hist; 1002 } hist;
1003 1003
1004 double dragged_began_timestamp;
1004 double anim_start; 1005 double anim_start;
1005 double anim_start2; 1006 double anim_start2;
1006 double anim_start3; 1007 double anim_start3;
diff --git a/legacy/elementary/src/lib/elm_priv.h b/legacy/elementary/src/lib/elm_priv.h
index dd4481add9..6f5d279514 100644
--- a/legacy/elementary/src/lib/elm_priv.h
+++ b/legacy/elementary/src/lib/elm_priv.h
@@ -172,6 +172,7 @@ struct _Elm_Config
172 unsigned char thumbscroll_bounce_enable; 172 unsigned char thumbscroll_bounce_enable;
173 double thumbscroll_border_friction; 173 double thumbscroll_border_friction;
174 double thumbscroll_sensitivity_friction; 174 double thumbscroll_sensitivity_friction;
175 unsigned char scroll_smooth_start_enable;
175 double scroll_smooth_time_interval; 176 double scroll_smooth_time_interval;
176 double scroll_smooth_amount; 177 double scroll_smooth_amount;
177 double scroll_smooth_history_weight; 178 double scroll_smooth_history_weight;