[ScrollBar (Handler)] Clean Up.
authorPrince Kumar Dubey <prince.dubey@samsung.com>
Fri, 16 Jul 2010 09:16:34 +0000 (14:46 +0530)
committerPrince Kumar Dubey <prince.dubey@samsung.com>
Fri, 16 Jul 2010 09:16:34 +0000 (14:46 +0530)
src/lib/elm_segment_control.c
src/lib/els_scroller.c

index bd29936..622e2c0 100755 (executable)
@@ -170,6 +170,21 @@ _layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data)
    return;
 }
 
+static void
+_segment_resizing(void *data)
+{
+       Widget_Data *wd = elm_widget_data_get((Evas_Object *)data);
+       if (!wd) return;
+       Evas_Coord w = 0, h = 0;
+
+       evas_object_geometry_get(wd->base, NULL, NULL, &w, &h);
+
+       wd->item_width = wd->width = w;
+       wd->height = h;
+
+       _state_value_set((Evas_Object *)data);
+}
+
 static void _object_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
        Widget_Data *wd;
@@ -177,15 +192,7 @@ static void _object_resize(void *data, Evas *e, Evas_Object *obj, void *event_in
        wd = elm_widget_data_get((Evas_Object *)data);
        if(!wd) return;
 
-       Evas_Coord w = 0, h = 0;
-
-       evas_object_geometry_get(wd->base, NULL, NULL, &w, &h);
-
-       if(wd->item_width != w && wd->height !=h)
-       {
-         wd->item_width = wd->width = w;
-         wd->height = h;
-       }
+       ecore_job_add(_segment_resizing, (Evas_Object *)data);
 }
 
 /**
index e53da6e..1ba998e 100755 (executable)
@@ -796,9 +796,9 @@ elm_smart_scroller_child_pos_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
      }
 
    if (sd->freeze_bounce == EINA_FALSE)
-   {
-          sd->pan_func.set(sd->pan_obj, x, y);
-   }
+     {
+       sd->pan_func.set(sd->pan_obj, x, y);
+     }
    if ((px != x) || (py != y))
      edje_object_signal_emit(sd->edje_obj, "elm,action,scroll", "elm");
    if (!sd->down.bounce_x_animator)
@@ -1165,15 +1165,8 @@ EAPI void
 elm_smart_scroller_handler_set(Evas_Object *obj)
 {
    API_ENTRY return;
-   Elm_Smart_Scroller_Policy *policy_h, *policy_v;
-   policy_h = ELM_SMART_SCROLLER_POLICY_OFF;
-   policy_v = ELM_SMART_SCROLLER_POLICY_OFF;
-
-   elm_smart_scroller_policy_get(obj, &policy_h, &policy_v);
-
-   if(policy_v != ELM_SMART_SCROLLER_POLICY_ON)
-          elm_smart_scroller_policy_set(obj, ELM_SMART_SCROLLER_POLICY_OFF, ELM_SMART_SCROLLER_POLICY_AUTO);
 
+   elm_smart_scroller_policy_set(obj, ELM_SMART_SCROLLER_POLICY_OFF, ELM_SMART_SCROLLER_POLICY_AUTO);
    edje_object_signal_emit(sd->edje_obj, "elm,activate,handler", "elm");
 }
 
@@ -1475,7 +1468,7 @@ _smart_event_post_up(void *data, Evas *e)
      {
         if (sd->down.dragged)
           {
-                sd->freeze_bounce = EINA_FALSE;
+             sd->freeze_bounce = EINA_FALSE;
              elm_widget_drag_lock_x_set(sd->widget, 0);
              elm_widget_drag_lock_y_set(sd->widget, 0);
           }