]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't set stretchable spacers size to 0, this doesn't work so use 1 instead.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 18 Jan 2010 00:29:05 +0000 (00:29 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 18 Jan 2010 00:29:05 +0000 (00:29 +0000)
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

src/msw/toolbar.cpp

index 31233565bd00a64bd82e1f518ad4f49fcf46df67..ce1595afa9eea4194631e58947dc876580437165 100644 (file)
@@ -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