# HG changeset patch # User Chris Cannam # Date 1427809592 -3600 # Node ID fcbfc7fad1f2bb3af17de67d546ecff16dbdeef4 # Parent d6acb8e3660571ced8a0403095d210db7df2c3a4 Allow setting big-image size directly diff -r d6acb8e36605 -r fcbfc7fad1f2 widgets/LevelPanToolButton.cpp --- a/widgets/LevelPanToolButton.cpp Tue Mar 31 14:08:06 2015 +0100 +++ b/widgets/LevelPanToolButton.cpp Tue Mar 31 14:46:32 2015 +0100 @@ -28,6 +28,7 @@ LevelPanToolButton::LevelPanToolButton(QWidget *parent) : QToolButton(parent), m_pixels(32), + m_pixelsBig(32 * 3), m_muted(false), m_savedLevel(1.f) { @@ -50,6 +51,7 @@ setMenu(menu); setImageSize(m_pixels); + setBigImageSize(m_pixelsBig); } LevelPanToolButton::~LevelPanToolButton() @@ -82,9 +84,15 @@ QPixmap px(m_pixels, m_pixels); px.fill(Qt::transparent); setIcon(px); +} - m_lpw->setFixedWidth(m_pixels * 3); - m_lpw->setFixedHeight(m_pixels * 3); +void +LevelPanToolButton::setBigImageSize(int pixels) +{ + m_pixelsBig = pixels; + + m_lpw->setFixedWidth(m_pixelsBig); + m_lpw->setFixedHeight(m_pixelsBig); } void diff -r d6acb8e36605 -r fcbfc7fad1f2 widgets/LevelPanToolButton.h --- a/widgets/LevelPanToolButton.h Tue Mar 31 14:08:06 2015 +0100 +++ b/widgets/LevelPanToolButton.h Tue Mar 31 14:46:32 2015 +0100 @@ -38,6 +38,8 @@ void setImageSize(int pixels); + void setBigImageSize(int pixels); + public slots: /// Set level in the range [0,1] -- will be rounded void setLevel(float); @@ -63,6 +65,7 @@ LevelPanWidget *m_lpw; int m_pixels; + int m_pixelsBig; bool m_muted; float m_savedLevel; };