make these friction and config values
authorCarsten Haitzler <raster@rasterman.com>
Thu, 24 Sep 2009 07:35:54 +0000 (07:35 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Thu, 24 Sep 2009 07:35:54 +0000 (07:35 +0000)
SVN revision: 42667

src/lib/elm_main.c
src/lib/elm_photocam.c
src/lib/elm_priv.h
src/lib/els_scroller.c

index 2116c74..2da1879 100644 (file)
@@ -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);
index a585c71..5daf7ce 100644 (file)
@@ -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);
index 3631103..3f9b73e 100644 (file)
@@ -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;
index ce9b1fa..f910fee 100644 (file)
@@ -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;