Don't drop selection when dragging from selected item
authorIván Briano <sachieru@gmail.com>
Thu, 5 Aug 2010 18:17:05 +0000 (18:17 +0000)
committerIván Briano <sachieru@gmail.com>
Thu, 5 Aug 2010 18:17:05 +0000 (18:17 +0000)
SVN revision: 50841

src/lib/elm_gengrid.c
src/lib/elm_genlist.c
src/lib/elm_list.c

index b070312..683c0a0 100644 (file)
@@ -239,7 +239,8 @@ _mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_inf
        if (!item->wd->on_hold) 
          {
             item->wd->on_hold = EINA_TRUE;
-            _item_unselect(item);
+             if (!item->wd->wasselected)
+               _item_unselect(item);
          }
      }
    if ((item->dragging) && (item->down))
@@ -282,9 +283,8 @@ _mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_inf
             ecore_timer_del(item->long_timer);
             item->long_timer = NULL;
          }
-       if (item->wd->wasselected)
+       if (!item->wd->wasselected)
          _item_unselect(item);
-       item->wd->wasselected = 0;
        if (dy < 0)
          {
             if (ady > adx)
index f435d09..c71d4a8 100644 (file)
@@ -590,7 +590,8 @@ _mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_inf
        if (!it->wd->on_hold)
          {
             it->wd->on_hold = EINA_TRUE;
-            _item_unselect(it);
+             if (!it->wd->wasselected)
+               _item_unselect(it);
          }
      }
    if ((it->dragging) && (it->down))
@@ -635,7 +636,6 @@ _mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_inf
           }
         if (!it->wd->wasselected)
           _item_unselect(it);
-        it->wd->wasselected = 0;
         if (dy < 0)
           {
              if (ady > adx)
@@ -688,7 +688,6 @@ _mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_inf
    Evas_Coord x, y;
 
    if (ev->button != 1) return;
-   Widget_Data *wd = elm_widget_data_get(it->wd->obj);
 
    it->down = 1;
    it->dragging  = 0;
@@ -704,7 +703,7 @@ _mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_inf
      evas_object_smart_callback_call(it->wd->obj, "clicked", it);
    if (it->long_timer) ecore_timer_del(it->long_timer);
    if (it->realized)
-     it->long_timer = ecore_timer_add(wd->longpress_timeout, _long_press, it);
+     it->long_timer = ecore_timer_add(it->wd->longpress_timeout, _long_press, it);
    else
      it->long_timer = NULL;
 }
index 3f37baa..fd41a28 100644 (file)
@@ -368,7 +368,8 @@ _mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void
                   ecore_timer_del(it->long_timer);
                   it->long_timer = NULL;
                }
-            _item_unselect(it);
+             if (!wd->wasselected)
+               _item_unselect(it);
          }
      }
 }