summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-08-02 17:30:34 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-08-02 17:32:19 +0900
commit7a70d415411cf9da302f7b1aa678913c42d18ee7 (patch)
treef1058eb3253e2ca4b4d60cebbab3b308b9fed09d
parentaad5b8b83e6542522b1a21972168fca1c2293c1d (diff)
downloadefl-7a70d415411cf9da302f7b1aa678913c42d18ee7.tar.gz
elm scroller accel was broken by default confgis setting it to 0. fix
now set default wheel scroll accel to 7 as epr the confgi upgrade code and also improve the acceleration to "rely on itself" and feedback loop. this is so much better now i can scroll through things in a whisk with the wheel. fixes T4263 @fix
-rw-r--r--config/default/base.src.in1
-rw-r--r--config/mobile/base.src.in1
-rw-r--r--config/standard/base.src.in1
-rw-r--r--src/lib/elementary/elm_interface_scrollable.c6
-rw-r--r--src/lib/elementary/elm_interface_scrollable.h1
5 files changed, 9 insertions, 1 deletions
diff --git a/config/default/base.src.in b/config/default/base.src.in
index 1817ffd179..089a4a4e30 100644
--- a/config/default/base.src.in
+++ b/config/default/base.src.in
@@ -23,6 +23,7 @@ group "Elm_Config" struct {
value "scroll_smooth_start_enable" uchar: 1;
value "scroll_smooth_amount" double: 1.0;
value "scroll_smooth_time_window" double: 0.15;
+ value "scroll_accel_factor" double: 7.0;
value "focus_autoscroll_mode" uchar: 0;
value "slider_indicator_visible_mode" int: 0;
value "scale" double: 1.0;
diff --git a/config/mobile/base.src.in b/config/mobile/base.src.in
index 3e15c10033..8265f47873 100644
--- a/config/mobile/base.src.in
+++ b/config/mobile/base.src.in
@@ -23,6 +23,7 @@ group "Elm_Config" struct {
value "scroll_smooth_start_enable" uchar: 1;
value "scroll_smooth_amount" double: 1.0;
value "scroll_smooth_time_window" double: 0.15;
+ value "scroll_accel_factor" double: 7.0;
value "focus_autoscroll_mode" uchar: 0;
value "slider_indicator_visible_mode" int: 0;
value "scale" double: 1.0;
diff --git a/config/standard/base.src.in b/config/standard/base.src.in
index 96847d768a..2bbb5aa1f7 100644
--- a/config/standard/base.src.in
+++ b/config/standard/base.src.in
@@ -23,6 +23,7 @@ group "Elm_Config" struct {
value "scroll_smooth_start_enable" uchar: 1;
value "scroll_smooth_amount" double: 1.0;
value "scroll_smooth_time_window" double: 0.15;
+ value "scroll_accel_factor" double: 7.0;
value "focus_autoscroll_mode" uchar: 0;
value "slider_indicator_visible_mode" int: 0;
value "scale" double: 1.0;
diff --git a/src/lib/elementary/elm_interface_scrollable.c b/src/lib/elementary/elm_interface_scrollable.c
index a92a503ed4..7c14d31e25 100644
--- a/src/lib/elementary/elm_interface_scrollable.c
+++ b/src/lib/elementary/elm_interface_scrollable.c
@@ -1942,9 +1942,13 @@ _scroll_wheel_post_event_cb(void *data, Evas *e EINA_UNUSED)
double delta_t = (double)(ev->timestamp - sid->last_wheel) / 1000.0;
double mul;
+ if (delta_t > 0.2) sid->last_wheel_mul = 0.0;
+ if (delta_t > 0.2) delta_t = 0.2;
mul = 1.0 + (_elm_config->scroll_accel_factor * ((0.2 - delta_t) / 0.2));
- if (delta_t < 0.2) d *= mul;
+ mul = mul * (1.0 + (0.15 * sid->last_wheel_mul));
+ d *= mul;
sid->last_wheel = ev->timestamp;
+ sid->last_wheel_mul = mul;
if (!direction)
{
if ((ch > vh) || (cw <= vw)) y += d * sid->step.y;
diff --git a/src/lib/elementary/elm_interface_scrollable.h b/src/lib/elementary/elm_interface_scrollable.h
index 21e17ffa97..f2167267ab 100644
--- a/src/lib/elementary/elm_interface_scrollable.h
+++ b/src/lib/elementary/elm_interface_scrollable.h
@@ -193,6 +193,7 @@ struct _Elm_Scrollable_Smart_Interface_Data
int page_limit_h, page_limit_v;
int current_calc;
+ double last_wheel_mul;
unsigned int last_wheel;
unsigned char size_adjust_recurse;