Skip to content

Commit

Permalink
LibGUI: Only consider starting a drag from an already selected item
Browse files Browse the repository at this point in the history
This means we can deselect other items immediately when performing a mouse-down
on an unselected item.
  • Loading branch information
bugaevc authored and awesomekling committed Jan 28, 2020
1 parent f9b4d98 commit 831ff2d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Libraries/LibGUI/GAbstractView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 831ff2d

Please sign in to comment.