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;