From 9947262eaadf43b1e8d67365e65765f47eb8a042 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 27 Aug 2020 18:41:54 +0200 Subject: [PATCH] LibGUI: Ctrl+clicking on an AbstractView should move cursor Don't just toggle the selection of the index, also move the cursor to where the user is clicking. --- Libraries/LibGUI/AbstractView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/LibGUI/AbstractView.cpp b/Libraries/LibGUI/AbstractView.cpp index 8f299b247e..343167cc93 100644 --- a/Libraries/LibGUI/AbstractView.cpp +++ b/Libraries/LibGUI/AbstractView.cpp @@ -214,7 +214,7 @@ void AbstractView::mousedown_event(MouseEvent& event) if (!index.is_valid()) { clear_selection(); } else if (event.modifiers() & Mod_Ctrl) { - toggle_selection(index); + set_cursor(index, SelectionUpdate::Ctrl); } else if (event.button() == MouseButton::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; @@ -438,7 +438,7 @@ void AbstractView::set_cursor(ModelIndex index, SelectionUpdate selection_update if (selection_update == SelectionUpdate::Set) selection().set(index); else if (selection_update == SelectionUpdate::Ctrl) - selection().toggle(index); + toggle_selection(index); // FIXME: Support the other SelectionUpdate types