From b8a5276bc8769248e3d5da9e5b391ece6b63dd46 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 28 Feb 2019 23:50:41 +0100 Subject: [PATCH] Use a symbolic constant for toolbar height adjustment hack value No real changes, just avoid hard-coding this 3 as it's going to be used in another place in the upcoming commit. --- src/msw/toolbar.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 63b1b44c79..2076c97e53 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -97,6 +97,13 @@ // Margin between the control and its label. static const int MARGIN_CONTROL_LABEL = 3; +// We make (flat-only) toolbars smaller by this amount than the value that +// would be given to them by TB_AUTOSIZE. This is done for cosmetic reasons and +// also to decrease the vertical space consumed by the toolbar and, finally and +// perhaps most significantly, for compatibility, as people dislike their +// toolbars changing height when updating to a new wxWidgets version. +static const int AUTOSIZE_HEIGHT_ADJUSTMENT = 3; + // ---------------------------------------------------------------------------- // wxWin macros // ---------------------------------------------------------------------------- @@ -1719,7 +1726,7 @@ void wxToolBar::UpdateSize() // at all if this is the right thing to do, but continue doing it now // for compatibility. if ( HasFlag(wxTB_FLAT) ) - size.y -= 3; + size.y -= AUTOSIZE_HEIGHT_ADJUSTMENT; } SetSize(wxRect(pos, size));