瀏覽代碼

LibGUI: Allow dragging a previously unselected item with a single click

Views would previously require that an item be selected before it could
be dragged. This patch makes us consider initiating a drag immediately
after the view has been selected, without requiring a mouseup event in
between.
Andreas Kling 4 年之前
父節點
當前提交
a7f4f6afc3
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Libraries/LibGUI/AbstractView.cpp

+ 1 - 0
Libraries/LibGUI/AbstractView.cpp

@@ -235,6 +235,7 @@ void AbstractView::mousedown_event(MouseEvent& event)
         set_cursor(index, SelectionUpdate::ClearIfNotSelected);
         set_cursor(index, SelectionUpdate::ClearIfNotSelected);
     } else {
     } else {
         set_cursor(index, SelectionUpdate::Set);
         set_cursor(index, SelectionUpdate::Set);
+        m_might_drag = true;
     }
     }
 
 
     update();
     update();