Reset selection on right click in a more efficient way

Instead of using HighlightAll(), use the second argument of
HighlightOnly() to remove selection from the previous current item.
This commit is contained in:
AliKet
2021-08-23 01:59:07 +02:00
committed by Vadim Zeitlin
parent 0e9e6aaf3a
commit cb6d67bab4

View File

@@ -2682,9 +2682,9 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
// Multi-selections should not be cleared if a selected item is clicked. // Multi-selections should not be cleared if a selected item is clicked.
if (!IsHighlighted(current)) if (!IsHighlighted(current))
{ {
HighlightAll(false); size_t oldCurrent = m_current;
ChangeCurrent(current); ChangeCurrent(current);
HighlightOnly(m_current); HighlightOnly(m_current, oldCurrent);
} }
SendNotify( current, wxEVT_LIST_ITEM_RIGHT_CLICK, event.GetPosition() ); SendNotify( current, wxEVT_LIST_ITEM_RIGHT_CLICK, event.GetPosition() );