[ScrollBar (handler)] Modified for smooth scrolling of scrollbar.
[framework/uifw/elementary.git] / src / lib / elm_genlist.c
old mode 100644 (file)
new mode 100755 (executable)
index 85a2643..5d6d661
@@ -7,6 +7,7 @@
 
 /**
  * @defgroup Genlist Genlist
+ * @ingroup Elementary
  *
  * The aim was to have  more expansive list that the simple list in
  * Elementary that could have more flexible items and allow many more entries
@@ -2736,10 +2737,7 @@ _item_idler(void *data)
 static void
 _item_queue(Widget_Data *wd, Elm_Genlist_Item *it)
 {
-   if (it->queued) return;
-   it->queued = EINA_TRUE;
-   wd->queue = eina_list_append(wd->queue, it);
-   while ((wd->queue) && ((!wd->blocks) || (!wd->blocks->next)))
+  while ((wd->queue) && ((!wd->blocks) || (!wd->blocks->next)))
      {
         if (wd->queue_idler)
           {
@@ -2748,7 +2746,11 @@ _item_queue(Widget_Data *wd, Elm_Genlist_Item *it)
           }
         _queue_proecess(wd, 0);
      }
+
+   if (it->queued) return;
    if (!wd->queue_idler) wd->queue_idler = ecore_idler_add(_item_idler, wd);
+   it->queued = EINA_TRUE;
+   wd->queue = eina_list_append(wd->queue, it);
 }
 #else
 
@@ -4408,3 +4410,25 @@ elm_genlist_set_edit_mode(Evas_Object *obj, int emode, Elm_Genlist_Edit_Class *e
     if (wd->calc_job) ecore_job_del(wd->calc_job);
     wd->calc_job = ecore_job_add(_calc_job, wd);
 }
+
+/**
+ * Set Scrollbar Handler mode
+ *
+ * This will activate the scrollbar handler mode for the genlist.
+ *
+ * @param obj The genlist object
+ * @param set if EINA_TRUE, activate handler.
+ *
+ * @ingroup Genlist
+ */
+
+EAPI void
+elm_genlist_scrollbar_handler_set(Evas_Object *obj, Eina_Bool set)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   if(!set) return;
+
+   elm_smart_scroller_handler_set(wd->scr);
+}