mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
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.
This commit is contained in:
parent
f9b4d981a8
commit
831ff2d0ac
Notes:
sideshowbarker
2024-07-19 09:45:35 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/831ff2d0ac8 Pull-request: https://github.com/SerenityOS/serenity/pull/1147
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user