From 75ce7fb68b111e754cdf2c23e2d6bb3d9a08ab03 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 9 Oct 2014 15:36:39 +0000 Subject: [PATCH] Fix excessive height of wxSlider with labels but no ticks in wxMSW. We shouldn't add the label height to the control best height as the labels are positioned at the same vertical level as the main part of the control. See #16604. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 4 ++++ src/msw/slider.cpp | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index c73058132a..740dd83507 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -581,6 +581,10 @@ All (GUI): - Fix several floating point rounding bugs in wxPropertyGrid (Artur Wieczorek). +wxMSW: + +- Fix best height of wxSlider with labels but without ticks (Artur Wieczorek). + 3.0.2: (released 2014-10-06) ---------------------------- diff --git a/src/msw/slider.cpp b/src/msw/slider.cpp index 992497c498..b4f5c2330d 100644 --- a/src/msw/slider.cpp +++ b/src/msw/slider.cpp @@ -544,10 +544,8 @@ wxSize wxSlider::DoGetBestSize() const { int labelSize = GetLabelsSize(); - // Min/max labels are compensated by the ticks so we don't need - // extra space for them if we're also showing ticks. - if ( HasFlag(wxSL_MIN_MAX_LABELS) && !HasFlag(wxSL_TICKS) ) - size.y += labelSize; + // Min/max labels are compensated by the thumb so we don't need + // extra space for them // The value label is always on top of the control and so does need // extra space in any case.