Fix issue with AUI toolbar overflow button always showing up

When resizing a wxAuiToolbar, the overflow button always showed up, and the
SetOverflowVisible() doesn't work as expected. E.g.

	tb->SetOverflowVisible(!tb->GetToolFitsByIndex(tb->GetToolCount()-1));
	tb->Refresh()

This was caused by the logic in OnPaint() ignoring the m_overflowVisible flag
and always drawing (or not drawing) the overflow button.

Add a check for it to fix this.

Closes https://github.com/wxWidgets/wxWidgets/pull/212
This commit is contained in:
Vadim Zeitlin 2016-02-13 12:22:04 +01:00
parent 0a555f3c83
commit 86b1181233

View File

@ -2466,7 +2466,7 @@ void wxAuiToolBar::OnPaint(wxPaintEvent& WXUNUSED(evt))
}
// paint the overflow button
if (dropdown_size > 0 && m_overflowSizerItem)
if (dropdown_size > 0 && m_overflowSizerItem && m_overflowVisible)
{
wxRect dropDownRect = GetOverflowRect();
m_art->DrawOverflowButton(dc, this, dropDownRect, m_overflowState);