mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-07 19:06:39 +00:00
Fix DynamicsPopup::MinMaxSlider when UI scale change
This commit is contained in:
parent
b6a86e6aea
commit
a6c55b0210
@ -54,6 +54,7 @@ class DynamicsPopup::MinMaxSlider : public Widget {
|
|||||||
public:
|
public:
|
||||||
MinMaxSlider() {
|
MinMaxSlider() {
|
||||||
setExpansive(true);
|
setExpansive(true);
|
||||||
|
initTheme();
|
||||||
}
|
}
|
||||||
|
|
||||||
float minThreshold() const { return m_minThreshold; }
|
float minThreshold() const { return m_minThreshold; }
|
||||||
@ -65,6 +66,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void onInitTheme(InitThemeEvent& ev) override {
|
void onInitTheme(InitThemeEvent& ev) override {
|
||||||
|
Widget::onInitTheme(ev);
|
||||||
SkinTheme* theme = static_cast<SkinTheme*>(this->theme());
|
SkinTheme* theme = static_cast<SkinTheme*>(this->theme());
|
||||||
setBorder(
|
setBorder(
|
||||||
gfx::Border(
|
gfx::Border(
|
||||||
@ -72,18 +74,12 @@ private:
|
|||||||
theme->parts.miniSliderEmpty()->bitmapN()->height(),
|
theme->parts.miniSliderEmpty()->bitmapN()->height(),
|
||||||
theme->parts.miniSliderEmpty()->bitmapE()->width(),
|
theme->parts.miniSliderEmpty()->bitmapE()->width(),
|
||||||
theme->parts.miniSliderEmpty()->bitmapS()->height()));
|
theme->parts.miniSliderEmpty()->bitmapS()->height()));
|
||||||
|
|
||||||
Widget::onInitTheme(ev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void onSizeHint(SizeHintEvent& ev) override {
|
void onSizeHint(SizeHintEvent& ev) override {
|
||||||
int w = 0;
|
ev.setSizeHint(
|
||||||
int h = 2*textHeight();
|
border().width(),
|
||||||
|
textHeight()+2*guiscale() + border().height());
|
||||||
w += border().width();
|
|
||||||
h += border().height();
|
|
||||||
|
|
||||||
ev.setSizeHint(w, h);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void onPaint(PaintEvent& ev) override {
|
void onPaint(PaintEvent& ev) override {
|
||||||
|
Loading…
Reference in New Issue
Block a user