From: Vadim Zeitlin Date: Mon, 18 Jan 2010 00:29:05 +0000 (+0000) Subject: Don't set stretchable spacers size to 0, this doesn't work so use 1 instead. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/187839afce1e1d4dca177bd78081c9d51ce549df Don't set stretchable spacers size to 0, this doesn't work so use 1 instead. If the toolbar is not big enough for its fixed-size contents, we set the size of the tools corresponding to stretchable spacers to 0 but this didn't really work and resulted in bad toolbar appearance even after resizing it to be big enough (as could be seen in samples/xrc). So set the spacers size to at least 1 to ensure that we do resize them correctly. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63173 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 31233565bd..ce1595afa9 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -1219,13 +1219,13 @@ void wxToolBar::UpdateStretchableSpacersSize() // reduce their size if there is not enough place for all tools const int totalSize = IsVertical() ? GetClientSize().y : GetClientSize().x; const int extraSize = totalSize - m_totalFixedSize; - const int sizeSpacer = extraSize > 0 ? extraSize / numSpaces : 0; + const int sizeSpacer = extraSize > 0 ? extraSize / numSpaces : 1; // the last spacer should consume all remaining space if we have too much // of it (which can be greater than sizeSpacer because of the rounding) const int sizeLastSpacer = extraSize > 0 ? extraSize - (numSpaces - 1)*sizeSpacer - : 0; + : 1; // cumulated offset by which we need to move all the following controls to // the right: while the toolbar takes care of the normal items, we must