mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-03-23 18:54:01 +08:00
Fix handling right and middle clicks in vertical wxAuiToolBar
They were wrongly recognized as clicks on the overflow item due to the hit test check being correct for horizontal toolbars only. Fix this by using the same, simpler and much more obviously correct, check that was already used for the left mouse button and just tests if GetOverflowRect() contains the point. Closes #26242.
This commit is contained in:
@@ -2850,16 +2850,10 @@ void wxAuiToolBar::OnRightDown(wxMouseEvent& evt)
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_overflowSizerItem && m_art)
|
||||
if (m_overflowSizerItem && m_overflowVisible && m_art)
|
||||
{
|
||||
int overflowSize = m_art->GetElementSizeForWindow(wxAUI_TBART_OVERFLOW_SIZE, this);
|
||||
if (overflowSize > 0 &&
|
||||
evt.m_x > cli_rect.width - overflowSize &&
|
||||
evt.m_y >= 0 &&
|
||||
evt.m_y < cli_rect.height)
|
||||
{
|
||||
if (GetOverflowRect().Contains(evt.GetX(), evt.GetY()))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_actionPos = wxPoint(evt.GetX(), evt.GetY());
|
||||
@@ -2922,16 +2916,10 @@ void wxAuiToolBar::OnMiddleDown(wxMouseEvent& evt)
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_overflowSizerItem && m_art)
|
||||
if (m_overflowSizerItem && m_overflowVisible && m_art)
|
||||
{
|
||||
int overflowSize = m_art->GetElementSizeForWindow(wxAUI_TBART_OVERFLOW_SIZE, this);
|
||||
if (overflowSize > 0 &&
|
||||
evt.m_x > cli_rect.width - overflowSize &&
|
||||
evt.m_y >= 0 &&
|
||||
evt.m_y < cli_rect.height)
|
||||
{
|
||||
if (GetOverflowRect().Contains(evt.GetX(), evt.GetY()))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_actionPos = wxPoint(evt.GetX(), evt.GetY());
|
||||
|
||||
Reference in New Issue
Block a user