Remove a now unnecessary hack for vertical toolbars

Don't recompute their total fixed size and update them once again in
Realize() as the button heights seem to be just fine even without doing
this.
This commit is contained in:
Vadim Zeitlin
2019-02-24 22:33:45 +01:00
parent 23dee36ec3
commit dc0586aad6

View File

@@ -1325,29 +1325,6 @@ bool wxToolBar::Realize()
InvalidateBestSize();
UpdateSize();
if ( IsVertical() )
{
// For vertical toolbar heights of buttons are incorrect
// unless TB_AUTOSIZE in invoked.
// We need to recalculate fixed elements size again.
m_totalFixedSize = 0;
toolIndex = 0;
for ( node = m_tools.GetFirst(); node; node = node->GetNext(), toolIndex++ )
{
wxToolBarTool * const tool = (wxToolBarTool*)node->GetData();
if ( !tool->IsStretchableSpace() )
{
const RECT r = wxGetTBItemRect(GetHwnd(), toolIndex);
if ( !IsVertical() )
m_totalFixedSize += r.right - r.left;
else if ( !tool->IsControl() )
m_totalFixedSize += r.bottom - r.top;
}
}
// Enforce invoking UpdateStretchableSpacersSize() with correct value of fixed elements size.
UpdateSize();
}
return true;
}