Merge "Fix elm_config_font_overlay_apply() to also apply rescaling properly. Changese...
[framework/uifw/elementary.git] / src / lib / elm_diskselector.c
index 8334d37..c2b5ff0 100644 (file)
@@ -385,6 +385,7 @@ static void
 _theme_data_get(Widget_Data *wd)
 {
    const char* str;
+   Evas_Object *parent;
    str = edje_object_data_get(wd->right_blank, "len_threshold");
    if (str) wd->len_threshold = MAX(0, atoi(str));
    else wd->len_threshold = 0;
@@ -397,11 +398,16 @@ _theme_data_get(Widget_Data *wd)
      }
 
    str = edje_object_data_get(wd->right_blank, "min_width");
-   if (str) wd->minw = MAX(-1, atoi(str));
-   else wd->minw = -1;
+   if (str) wd->minw = MAX(-1, atoi(str)) * elm_scale_get();
+   else
+     {
+        parent = elm_widget_parent_widget_get(wd->self);
+        if (!parent) wd->minw = -1;
+        else evas_object_geometry_get(parent, NULL, NULL, &wd->minw, NULL);
+     }
 
    str = edje_object_data_get(wd->right_blank, "min_height");
-   if (str) wd->minh = MAX(-1, atoi(str));
+   if (str) wd->minh = MAX(-1, atoi(str)) * elm_scale_get();
    else wd->minh = -1;
 }
 
@@ -410,6 +416,11 @@ _del_hook(Evas_Object * obj)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
+   if (wd->idler)
+     {
+        ecore_idle_enterer_del(wd->idler);
+        wd->idler = NULL;
+     }
    free(wd);
 }
 
@@ -790,7 +801,11 @@ _move_scroller(void *data)
      }
 
    evas_object_geometry_get(wd->scroller, NULL, &y, &w, &h);
-   elm_smart_scroller_child_region_show(wd->scroller, w / wd->display_item_num * i, y, w, h);
+   //move scroller in two steps for getting smooth launching effect.
+   if (i > 2)
+     elm_smart_scroller_child_region_show(wd->scroller, w / wd->display_item_num * (i-2), y, w, h);
+   elm_smart_scroller_region_bring_in(wd->scroller, w / wd->display_item_num * i, y, w, h);
+
    _select_item(dit);
    if (wd->idler)
      {
@@ -1013,7 +1028,6 @@ _item_content_get_hook(const Elm_Object_Item *it, const char *part)
    return ((Elm_Diskselector_Item *)it)->icon;
 }
 
-
 EAPI Evas_Object *
 elm_diskselector_add(Evas_Object *parent)
 {