From a6c55b02106b6d42ccac9e8a7f22a80d41a71f08 Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 24 Apr 2020 12:34:54 -0300 Subject: [PATCH] Fix DynamicsPopup::MinMaxSlider when UI scale change --- src/app/ui/dynamics_popup.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/app/ui/dynamics_popup.cpp b/src/app/ui/dynamics_popup.cpp index ea11d2bf1..9107bc692 100644 --- a/src/app/ui/dynamics_popup.cpp +++ b/src/app/ui/dynamics_popup.cpp @@ -54,6 +54,7 @@ class DynamicsPopup::MinMaxSlider : public Widget { public: MinMaxSlider() { setExpansive(true); + initTheme(); } float minThreshold() const { return m_minThreshold; } @@ -65,6 +66,7 @@ public: private: void onInitTheme(InitThemeEvent& ev) override { + Widget::onInitTheme(ev); SkinTheme* theme = static_cast(this->theme()); setBorder( gfx::Border( @@ -72,18 +74,12 @@ private: theme->parts.miniSliderEmpty()->bitmapN()->height(), theme->parts.miniSliderEmpty()->bitmapE()->width(), theme->parts.miniSliderEmpty()->bitmapS()->height())); - - Widget::onInitTheme(ev); } void onSizeHint(SizeHintEvent& ev) override { - int w = 0; - int h = 2*textHeight(); - - w += border().width(); - h += border().height(); - - ev.setSizeHint(w, h); + ev.setSizeHint( + border().width(), + textHeight()+2*guiscale() + border().height()); } void onPaint(PaintEvent& ev) override {