From dc0586aad6fac787ab10e0d07f784ebd90e41ef9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 24 Feb 2019 22:33:45 +0100 Subject: [PATCH] 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. --- src/msw/toolbar.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 2cdf24f9b1..eb7f54b08e 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -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; }