diff options
author | Sergey Bugaev <bugaevc@serenityos.org> | 2020-01-28 16:25:46 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-01-28 15:08:27 +0100 |
commit | 831ff2d0ac8d2d19d4ab3c6b870fc3ffa9da1c5c (patch) | |
tree | 7ec88d73bf60b0097423658768538665a99f3a66 | |
parent | f9b4d981a8518974e31a4f79e83a7e06fa3f0fb5 (diff) | |
download | serenity-831ff2d0ac8d2d19d4ab3c6b870fc3ffa9da1c5c.zip |
LibGUI: Only consider starting a drag from an already selected item
This means we can deselect other items immediately when performing a mouse-down
on an unselected item.
-rw-r--r-- | Libraries/LibGUI/GAbstractView.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Libraries/LibGUI/GAbstractView.cpp b/Libraries/LibGUI/GAbstractView.cpp index b979d6d491..9c05e72505 100644 --- a/Libraries/LibGUI/GAbstractView.cpp +++ b/Libraries/LibGUI/GAbstractView.cpp @@ -191,10 +191,9 @@ void GAbstractView::mousedown_event(GMouseEvent& event) m_selection.clear(); } else if (event.modifiers() & Mod_Ctrl) { m_selection.toggle(index); - } else if (event.button() == GMouseButton::Left && !m_model->drag_data_type().is_null()) { + } else if (event.button() == GMouseButton::Left && m_selection.contains(index) && !m_model->drag_data_type().is_null()) { // We might be starting a drag, so don't throw away other selected items yet. m_might_drag = true; - m_selection.add(index); } else { m_selection.set(index); } |