diff --git a/include/PixmapButton.h b/include/PixmapButton.h index 734bd11ae5c..a0b4141deba 100644 --- a/include/PixmapButton.h +++ b/include/PixmapButton.h @@ -45,6 +45,7 @@ class LMMS_EXPORT PixmapButton : public AutomatableButton void setInactiveGraphic( const QPixmap & _pm, bool _update = true ); QSize sizeHint() const override; + QSize minimumSizeHint() const override; signals: void doubleClicked(); diff --git a/src/gui/widgets/PixmapButton.cpp b/src/gui/widgets/PixmapButton.cpp index 069acad567c..5f2e01b3d24 100644 --- a/src/gui/widgets/PixmapButton.cpp +++ b/src/gui/widgets/PixmapButton.cpp @@ -124,16 +124,13 @@ void PixmapButton::setInactiveGraphic( const QPixmap & _pm, bool _update ) QSize PixmapButton::sizeHint() const { - if (isActive()) - { - return m_activePixmap.size(); - } - else - { - return m_inactivePixmap.size(); - } + return minimumSizeHint(); } +QSize PixmapButton::minimumSizeHint() const +{ + return m_activePixmap.size().expandedTo(m_inactivePixmap.size()); +} bool PixmapButton::isActive() const {