From c7e8aac70f319c1224594d9733069adb30d0a9e1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 24 Feb 2019 03:49:56 +0100 Subject: [PATCH] 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. --- src/msw/toolbar.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 5a28b58295..9f60b5b773 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -1200,10 +1200,15 @@ bool wxToolBar::Realize() if ( !tool->IsControl() ) { - if ( IsVertical() ) - m_totalFixedSize += r.bottom - r.top; - else - m_totalFixedSize += r.right - r.left; + // 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; }