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:
@@ -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() );
|
||||||
|
Reference in New Issue
Block a user