Explicitly skip expanding stretchable separators in MSW toolbars

When computing the fixed size of MSW toolbars, don't take stretchable
separators into account as this doesn't make sense and so, even if this
doesn't matter currently because the separators still have their
initial, fixed size when total fixed size is computed, but would start
mattering if UpdateStretchableSpacersSize() is ever called before this
is done and it also just makes more sense to skip them here.
This commit is contained in:
Vadim Zeitlin
2019-02-24 03:49:56 +01:00
parent 44d732b8a5
commit c7e8aac70f

View File

@@ -1199,11 +1199,16 @@ bool wxToolBar::Realize()
const RECT r = wxGetTBItemRect(GetHwnd(), toolIndex, tool->GetId());
if ( !tool->IsControl() )
{
// Stretchable space don't have any fixed size and their current
// size shouldn't count at all.
if ( !tool->IsStretchableSpace() )
{
if ( IsVertical() )
m_totalFixedSize += r.bottom - r.top;
else
m_totalFixedSize += r.right - r.left;
}
continue;
}