From: Jaehwan Kim Date: Fri, 3 May 2013 04:19:27 +0000 (+0900) Subject: Sync with open source about the config(min_friction, friction_standard) X-Git-Tag: accepted/tizen/20130927.071315^2~370 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f360737172a003bf5ba09eaea1bed1b43862bdc0;p=profile%2Fmobile%2Felementary.git Sync with open source about the config(min_friction, friction_standard) Change-Id: I59964d643500133d8d5d95a813dcce15cb1bfb77 --- diff --git a/config/default/base.src b/config/default/base.src index af84256..31a50cd 100644 --- a/config/default/base.src +++ b/config/default/base.src @@ -8,7 +8,7 @@ group "Elm_Config" struct { value "thumbscroll_momentum_threshold" double: 100.0; value "thumbscroll_friction" double: 1.0; value "thumbscroll_min_friction" double: 1.0; - value "thumbscroll_friction_standard" int: 2000; + value "thumbscroll_friction_standard" double: 2000.0; value "thumbscroll_bounce_friction" double: 0.5; value "thumbscroll_bounce_enable" uchar: 1; value "page_scroll_friction" double: 0.5; diff --git a/config/desktop/base.src b/config/desktop/base.src index fb66a14..8f09b88 100644 --- a/config/desktop/base.src +++ b/config/desktop/base.src @@ -7,7 +7,7 @@ group "Elm_Config" struct { value "thumbscroll_momentum_threshold" double: 100.0; value "thumbscroll_friction" double: 1.0; value "thumbscroll_min_friction" double: 1.0; - value "thumbscroll_friction_standard" int: 2000; + value "thumbscroll_friction_standard" double: 2000.0; value "thumbscroll_bounce_friction" double: 0.5; value "thumbscroll_bounce_enable" uchar: 0; value "page_scroll_friction" double: 0.5; diff --git a/config/illume/base.src b/config/illume/base.src index bc51b2f..99249dc 100644 --- a/config/illume/base.src +++ b/config/illume/base.src @@ -7,7 +7,7 @@ group "Elm_Config" struct { value "thumbscroll_momentum_threshold" double: 100.0; value "thumbscroll_friction" double: 1.0; value "thumbscroll_min_friction" double: 1.0; - value "thumbscroll_friction_standard" int: 2000; + value "thumbscroll_friction_standard" double: 2000.0; value "thumbscroll_bounce_friction" double: 0.5; value "thumbscroll_bounce_enable" uchar: 1; value "page_scroll_friction" double: 0.5; diff --git a/config/mobile/base.src b/config/mobile/base.src index 702c1d5..3a29cbb 100644 --- a/config/mobile/base.src +++ b/config/mobile/base.src @@ -8,7 +8,7 @@ group "Elm_Config" struct { value "thumbscroll_momentum_threshold" double: 100.0; value "thumbscroll_friction" double: 1.0; value "thumbscroll_min_friction" double: 0.3; - value "thumbscroll_friction_standard" int: 3000; + value "thumbscroll_friction_standard" double: 3000.0; value "thumbscroll_bounce_friction" double: 0.5; value "thumbscroll_bounce_enable" uchar: 0; value "page_scroll_friction" double: 0.5; diff --git a/config/standard/base.src b/config/standard/base.src index 9da0314..0c20e3c 100644 --- a/config/standard/base.src +++ b/config/standard/base.src @@ -7,6 +7,8 @@ group "Elm_Config" struct { value "thumbscroll_hold_threshold" int: 4; value "thumbscroll_momentum_threshold" double: 100.0; value "thumbscroll_friction" double: 1.0; + value "thumbscroll_min_friction" double: 1.0; + value "thumbscroll_friction_standard" double: 2000.0; value "thumbscroll_bounce_friction" double: 0.5; value "thumbscroll_bounce_enable" uchar: 0; value "page_scroll_friction" double: 0.5; @@ -14,6 +16,7 @@ group "Elm_Config" struct { value "zoom_friction" double: 0.5; value "thumbscroll_border_friction" double: 0.5; value "thumbscroll_sensitivity_friction" double: 0.25; + value "scroll_smooth_start_enable" uchar: 0; value "scroll_smooth_amount" double: 0.0; value "scroll_smooth_history_weight" double: 0.1; value "scroll_smooth_future_time" double: 0.0; diff --git a/src/bin/config.c b/src/bin/config.c index 5daca3a..244bb80 100644 --- a/src/bin/config.c +++ b/src/bin/config.c @@ -372,6 +372,56 @@ tsf_change(void *data __UNUSED__, } static void +tsmf_round(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) +{ + double val = elm_slider_value_get(obj); + double v; + + v = ((double)((int)(val * 10.0))) / 10.0; + if (v != val) elm_slider_value_set(obj, v); +} + +static void +tsmf_change(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) +{ + double tsmf = elm_config_scroll_thumbscroll_min_friction_get(); + double val = elm_slider_value_get(obj); + + if (tsmf == val) return; + elm_config_scroll_thumbscroll_min_friction_set(val); + elm_config_all_flush(); +} + +static void +tsfs_round(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) +{ + double val = elm_slider_value_get(obj); + double v; + + v = ((double)((int)(val * 10.0))) / 10.0; + if (v != val) elm_slider_value_set(obj, v); +} + +static void +tsfs_change(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) +{ + double tsfs = elm_config_scroll_thumbscroll_friction_standard_get(); + double val = elm_slider_value_get(obj); + + if (tsfs == val) return; + elm_config_scroll_thumbscroll_friction_standard_set(val); + elm_config_all_flush(); +} + +static void tsbf_round(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) @@ -972,9 +1022,13 @@ _font_overlay_change(void *data __UNUSED__, static void _config_display_update(Evas_Object *win) { - int flush_interval, font_c, image_c, edje_file_c, edje_col_c, ts_threshould, ts_hold_threshold; + int flush_interval, font_c, image_c, edje_file_c, edje_col_c, ts_threshould, + ts_hold_threshold; double scale, s_bounce_friction, ts_momentum_threshold, ts_friction, - ts_border_friction, ts_sensitivity_friction, page_friction, bring_in_friction, zoom_friction; + ts_min_friction, ts_friction_standard, ts_border_friction, + ts_sensitivity_friction, ts_acceleration_threshold, + ts_acceleration_time_limit, ts_acceleration_weight, page_friction, + bring_in_friction, zoom_friction; const char *curr_theme, *curr_engine; const Eina_List *l_items, *l; Eina_Bool s_bounce, ts; @@ -997,6 +1051,8 @@ _config_display_update(Evas_Object *win) ts_hold_threshold = elm_config_scroll_thumbscroll_hold_threshold_get(); ts_momentum_threshold = elm_config_scroll_thumbscroll_momentum_threshold_get(); ts_friction = elm_config_scroll_thumbscroll_friction_get(); + ts_min_friction = elm_config_scroll_thumbscroll_min_friction_get(); + ts_friction_standard = elm_config_scroll_thumbscroll_friction_standard_get(); ts_border_friction = elm_config_scroll_thumbscroll_border_friction_get(); ts_sensitivity_friction = elm_config_scroll_thumbscroll_sensitivity_friction_get(); page_friction = elm_config_scroll_page_scroll_friction_get(); @@ -1037,6 +1093,12 @@ _config_display_update(Evas_Object *win) elm_slider_value_set(evas_object_data_get(win, "thumbscroll_friction_slider"), ts_friction); + elm_slider_value_set(evas_object_data_get(win, + "thumbscroll_min_friction_slider"), + ts_min_friction); + elm_slider_value_set(evas_object_data_get(win, + "thumbscroll_friction__standard_slider"), + ts_friction); elm_slider_value_set(evas_object_data_get(win, "ts_border_friction_slider"), ts_border_friction); elm_slider_value_set(evas_object_data_get(win, "ts_sensitivity_friction_slider"), @@ -2708,6 +2770,47 @@ _status_config_scrolling(Evas_Object *win, evas_object_smart_callback_add(sl, "changed", tsf_round, NULL); evas_object_smart_callback_add(sl, "delay,changed", tsf_change, NULL); + LABEL_FRAME_ADD("Thumb scroll min friction"); + + sl = elm_slider_add(win); + elm_object_tooltip_text_set(sl, "This is the min amount of inertia a
" + "scroller will impose at self scrolling
" + "animations"); + evas_object_data_set(win, "thumbscroll_min_friction_slider", sl); + evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); + elm_slider_span_size_set(sl, 120); + elm_slider_unit_format_set(sl, "%1.1f"); + elm_slider_indicator_format_set(sl, "%1.1f"); + elm_slider_min_max_set(sl, 0.0, 15.0); + elm_slider_value_set(sl, elm_config_scroll_thumbscroll_min_friction_get()); + elm_box_pack_end(bx, sl); + evas_object_show(sl); + + evas_object_smart_callback_add(sl, "changed", tsmf_round, NULL); + evas_object_smart_callback_add(sl, "delay,changed", tsmf_change, NULL); + + LABEL_FRAME_ADD("Thumb scroll friction standard"); + + sl = elm_slider_add(win); + elm_object_tooltip_text_set(sl, "This is the standard velocity of the scroller." + "
The scroll animation time is same
" + "with thumbscroll friction, if the velocity" + "
is same with standard velocity."); + evas_object_data_set(win, "thumbscroll_friction_standard_slider", sl); + evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); + elm_slider_span_size_set(sl, 120); + elm_slider_unit_format_set(sl, "%1.0f pixel/s"); + elm_slider_indicator_format_set(sl, "%1.0f"); + elm_slider_min_max_set(sl, 10.0, 5000.0); + elm_slider_value_set(sl, elm_config_scroll_thumbscroll_friction_standard_get()); + elm_box_pack_end(bx, sl); + evas_object_show(sl); + + evas_object_smart_callback_add(sl, "changed", tsfs_round, NULL); + evas_object_smart_callback_add(sl, "delay,changed", tsfs_change, NULL); + LABEL_FRAME_ADD("Thumb scroll border friction"); sl = elm_slider_add(win); diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c index 3c1976c..a337f9a 100644 --- a/src/lib/elm_config.c +++ b/src/lib/elm_config.c @@ -333,7 +333,7 @@ _desc_init(void) ELM_CONFIG_VAL(D, T, thumbscroll_momentum_threshold, T_DOUBLE); ELM_CONFIG_VAL(D, T, thumbscroll_friction, T_DOUBLE); ELM_CONFIG_VAL(D, T, thumbscroll_min_friction, T_DOUBLE); - ELM_CONFIG_VAL(D, T, thumbscroll_friction_standard, T_INT); + ELM_CONFIG_VAL(D, T, thumbscroll_friction_standard, T_DOUBLE); ELM_CONFIG_VAL(D, T, thumbscroll_bounce_friction, T_DOUBLE); ELM_CONFIG_VAL(D, T, thumbscroll_border_friction, T_DOUBLE); ELM_CONFIG_VAL(D, T, thumbscroll_sensitivity_friction, T_DOUBLE); @@ -1032,7 +1032,7 @@ _config_load(void) _elm_config->thumbscroll_momentum_threshold = 100.0; _elm_config->thumbscroll_friction = 1.0; _elm_config->thumbscroll_min_friction = 0.5; - _elm_config->thumbscroll_friction_standard = 1000; + _elm_config->thumbscroll_friction_standard = 1000.0; _elm_config->thumbscroll_bounce_friction = 0.5; _elm_config->thumbscroll_bounce_enable = EINA_TRUE; _elm_config->page_scroll_friction = 0.5; @@ -1429,7 +1429,7 @@ _env_get(void) s = getenv("ELM_THUMBSCROLL_MIN_FRICTION"); if (s) _elm_config->thumbscroll_min_friction = _elm_atof(s); s = getenv("ELM_THUMBSCROLL_FRICTION_STANDARD"); - if (s) _elm_config->thumbscroll_friction_standard = atoi(s); + if (s) _elm_config->thumbscroll_friction_standard = _elm_atof(s); s = getenv("ELM_THUMBSCROLL_BOUNCE_ENABLE"); if (s) _elm_config->thumbscroll_bounce_enable = !!atoi(s); s = getenv("ELM_THUMBSCROLL_BOUNCE_FRICTION"); @@ -2137,14 +2137,14 @@ elm_config_scroll_thumbscroll_min_friction_set(double friction) _elm_config->thumbscroll_min_friction = friction; } -EAPI int +EAPI double elm_config_scroll_thumbscroll_friction_standard_get(void) { return _elm_config->thumbscroll_friction_standard; } EAPI void -elm_config_scroll_thumbscroll_friction_standard_set(int standard) +elm_config_scroll_thumbscroll_friction_standard_set(double standard) { _elm_config->thumbscroll_friction_standard = standard; } diff --git a/src/lib/elm_config.h b/src/lib/elm_config.h index 6aef84a..b7157b5 100644 --- a/src/lib/elm_config.h +++ b/src/lib/elm_config.h @@ -410,7 +410,7 @@ EAPI void elm_config_scroll_thumbscroll_min_friction_set(double friction * * @ingroup Scrolling */ -EAPI int elm_config_scroll_thumbscroll_friction_standard_get(void); +EAPI double elm_config_scroll_thumbscroll_friction_standard_get(void); /** * Set the standard velocity of the scroller. The scroll animation time is @@ -422,7 +422,7 @@ EAPI int elm_config_scroll_thumbscroll_friction_standard_get(void); * @see elm_config_thumbscroll_friction_standard_get() * @ingroup Scrolling */ -EAPI void elm_config_scroll_thumbscroll_friction_standard_set(int standard); +EAPI void elm_config_scroll_thumbscroll_friction_standard_set(double standard); /** * Get the amount of lag between your actual mouse cursor dragging diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h index f29cab6..b7567af 100644 --- a/src/lib/elm_priv.h +++ b/src/lib/elm_priv.h @@ -163,7 +163,7 @@ struct _Elm_Config double thumbscroll_momentum_threshold; double thumbscroll_friction; double thumbscroll_min_friction; - int thumbscroll_friction_standard; + double thumbscroll_friction_standard; double thumbscroll_bounce_friction; double page_scroll_friction; double bring_in_scroll_friction;