Merge "[elm_button.c, elm_check.c] Fixed Build warnings."
authorRajeev Ranjan <rajeev.r@samsung.com>
Fri, 23 Sep 2011 04:07:15 +0000 (13:07 +0900)
committerGerrit Code Review <git@Maetan>
Fri, 23 Sep 2011 04:07:15 +0000 (13:07 +0900)
src/lib/elm_genlist.c
src/lib/els_scroller.c

index 52b45fd..0c61801 100644 (file)
@@ -244,6 +244,9 @@ static void      _signal_emit_hook(Evas_Object *obj,
                                    const char *source);
 static Eina_Bool _deselect_all_items(Widget_Data *wd);
 static void      _pan_calculate(Evas_Object *obj);
+static void      _pan_max_get(Evas_Object *obj,
+                              Evas_Coord  *x,
+                              Evas_Coord  *y);
 static void      _item_position(Elm_Genlist_Item *it,
                                 Evas_Object      *obj,
                                 Evas_Coord        it_x,
@@ -340,6 +343,7 @@ _event_hook(Evas_Object       *obj,
    if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
    Evas_Event_Key_Down *ev = event_info;
    Widget_Data *wd = elm_widget_data_get(obj);
+   Evas_Coord pan_max_x = 0, pan_max_y = 0;
    if (!wd) return EINA_FALSE;
    if (!wd->items) return EINA_FALSE;
    if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
@@ -444,6 +448,11 @@ _event_hook(Evas_Object       *obj,
    else return EINA_FALSE;
 
    ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+   _pan_max_get(wd->pan_smart, &pan_max_x, &pan_max_y);
+   if (x < 0) x = 0;
+   if (x > pan_max_x) x = pan_max_x;
+   if (y < 0) y = 0;
+   if (y > pan_max_y) y = pan_max_y;
    elm_smart_scroller_child_pos_set(wd->scr, x, y);
    return EINA_TRUE;
 }
index 051c182..3cc79ec 100644 (file)
@@ -1970,11 +1970,6 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *ev
                                    }
                               }
                          }
-                       if (sd->down.hold_animator)
-                         {
-                            ecore_animator_del(sd->down.hold_animator);
-                            sd->down.hold_animator = NULL;
-                         }
                     }
                   else
                     {
@@ -2031,11 +2026,13 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *ev
                             if (pgy != y) _smart_scrollto_y(sd, _elm_config->page_scroll_friction, pgy);
                          }
                     }
-                  if (sd->down.hold_animator)
-                    {
-                       ecore_animator_del(sd->down.hold_animator);
-                       sd->down.hold_animator = NULL;
-                    }
+               }
+             if (sd->down.hold_animator)
+               {
+                  ecore_animator_del(sd->down.hold_animator);
+                  sd->down.hold_animator = NULL;
+                  if (sd->child.resized)
+                    _elm_smart_scroller_wanted_region_set(sd->smart_obj);
                }
              if (sd->down.scroll)
                {