mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
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.
This commit is contained in:
parent
56e80fafd6
commit
9947262eaa
Notes:
sideshowbarker
2024-07-19 03:05:21 +09:00
Author: https://github.com/awesomekling
Commit: 9947262eaa
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue