From 9765f671563f5691fb1bdfaea49fa5542b970f27 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 25 Jul 2012 16:31:58 +0000 Subject: [PATCH] wxMSW: Use TBSTYLE_AUTOSIZE for toolbar buttons with horizontal text. Without this style, all buttons share the same width and look ugly when their labels differ even a little in their lengths. With TBSTYLE_AUTOSIZE, toolbar buttons use the size of their image plus label's width and look better, even though their sizes differ. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/toolbar.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 884fedaf40..7eaea5ca0f 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -1053,6 +1053,14 @@ bool wxToolBar::Realize() break; } + // Instead of using fixed widths for all buttons, size them + // automatically according to the size of their bitmap and text + // label, if present. This particularly matters for toolbars + // with the wxTB_HORZ_LAYOUT style: they look hideously ugly + // without autosizing when the labels have even slightly + // different lengths. + button.fsStyle |= TBSTYLE_AUTOSIZE; + bitmapId++; break; } -- 2.45.2