mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 19:45:08 +00: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
1 changed files with 1 additions and 2 deletions
|
@ -191,10 +191,9 @@ void GAbstractView::mousedown_event(GMouseEvent& event)
|
||||||
m_selection.clear();
|
m_selection.clear();
|
||||||
} else if (event.modifiers() & Mod_Ctrl) {
|
} else if (event.modifiers() & Mod_Ctrl) {
|
||||||
m_selection.toggle(index);
|
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.
|
// We might be starting a drag, so don't throw away other selected items yet.
|
||||||
m_might_drag = true;
|
m_might_drag = true;
|
||||||
m_selection.add(index);
|
|
||||||
} else {
|
} else {
|
||||||
m_selection.set(index);
|
m_selection.set(index);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue