From: Carsten Haitzler Date: Thu, 24 Sep 2009 07:35:54 +0000 (+0000) Subject: make these friction and config values X-Git-Tag: v1.0.0~5209 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b160c88895463d3fed127d0f62c90926db5ece9f;p=platform%2Fupstream%2Felementary.git make these friction and config values SVN revision: 42667 --- diff --git a/src/lib/elm_main.c b/src/lib/elm_main.c index 2116c74..2da1879 100644 --- a/src/lib/elm_main.c +++ b/src/lib/elm_main.c @@ -504,6 +504,8 @@ elm_quicklaunch_init(int argc, char **argv) _elm_config->thumbscroll_friction = 1.0; _elm_config->thumbscroll_bounce_friction = 0.5; _elm_config->thumbscroll_bounce_enable = 1; + _elm_config->page_scroll_friction = 0.5; + _elm_config->zoom_friction = 0.5; _elm_config->scale = 1.0; _elm_config->font_hinting = 2; _elm_config->font_dirs = NULL; @@ -560,6 +562,10 @@ elm_quicklaunch_init(int argc, char **argv) if (s) _elm_config->thumbscroll_momentum_threshhold = atof(s); s = getenv("ELM_THUMBSCROLL_FRICTION"); if (s) _elm_config->thumbscroll_friction = atof(s); + s = getenv("ELM_PAGE_SCROLL_FRICTION"); + if (s) _elm_config->page_scroll_friction = atof(s); + s = getenv("ELM_ZOOM_FRICTION"); + if (s) _elm_config->zoom_friction = atof(s); s = getenv("ELM_THEME"); if (s) _elm_theme_parse(s); diff --git a/src/lib/elm_photocam.c b/src/lib/elm_photocam.c index a585c71..5daf7ce 100644 --- a/src/lib/elm_photocam.c +++ b/src/lib/elm_photocam.c @@ -832,7 +832,7 @@ elm_photocam_zoom_set(Evas_Object *obj, int zoom) elm_smart_scroller_child_viewport_size_get(wd->scr, &rw, &rh); wd->size.spos.x = (double)(rx + (rw / 2)) / (double)wd->size.w; wd->size.spos.y = (double)(ry + (rh / 2)) / (double)wd->size.h; - wd->t_end = wd->t_start + 0.5; + wd->t_end = wd->t_start + _elm_config->zoom_friction; an = wd->zoom_animator; if (!_zoom_anim(obj)) ecore_animator_del(an); if (wd->calc_job) ecore_job_del(wd->calc_job); diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h index 3631103..3f9b73e 100644 --- a/src/lib/elm_priv.h +++ b/src/lib/elm_priv.h @@ -43,6 +43,8 @@ struct _Elm_Config double thumbscroll_momentum_threshhold; double thumbscroll_friction; double thumbscroll_bounce_friction; + double page_scroll_friction; + double zoom_friction; int thumbscroll_bounce_enable; double scale; int bgpixmap; diff --git a/src/lib/els_scroller.c b/src/lib/els_scroller.c index ce9b1fa..f910fee 100644 --- a/src/lib/els_scroller.c +++ b/src/lib/els_scroller.c @@ -1034,11 +1034,11 @@ elm_smart_scroller_region_bring_in(Evas_Object *obj, Evas_Coord x, Evas_Coord y, x = nx; if (x < 0) x = 0; else if ((x + w) > cw) x = cw - w; - _smart_scrollto_x(sd, 1.0, x); + _smart_scrollto_x(sd, _elm_config->page_scroll_friction, x); y = ny; if (y < 0) y = 0; else if ((y + h) > ch) y = ch - h; - _smart_scrollto_y(sd, 1.0, y); + _smart_scrollto_y(sd, _elm_config->page_scroll_friction, y); } /* local subsystem functions */ @@ -1414,9 +1414,9 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); pgx = _smart_page_x_get(sd, ox); - if (pgx != x) _smart_scrollto_x(sd, 1.0, pgx); + if (pgx != x) _smart_scrollto_x(sd, _elm_config->page_scroll_friction, pgx); pgy = _smart_page_y_get(sd, oy); - if (pgy != y) _smart_scrollto_y(sd, 1.0, pgy); + if (pgy != y) _smart_scrollto_y(sd, _elm_config->page_scroll_friction, pgy); } } else @@ -1427,9 +1427,9 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); pgx = _smart_page_x_get(sd, ox); - if (pgx != x) _smart_scrollto_x(sd, 1.0, pgx); + if (pgx != x) _smart_scrollto_x(sd, _elm_config->page_scroll_friction, pgx); pgy = _smart_page_y_get(sd, oy); - if (pgy != y) _smart_scrollto_y(sd, 1.0, pgy); + if (pgy != y) _smart_scrollto_y(sd, _elm_config->page_scroll_friction, pgy); } } sd->down.dragged = 0;