Mercurial > hg > svgui
changeset 942:fcbfc7fad1f2 tonioni
Allow setting big-image size directly
author | Chris Cannam |
---|---|
date | Tue, 31 Mar 2015 14:46:32 +0100 |
parents | d6acb8e36605 |
children | 788b7623bfca |
files | widgets/LevelPanToolButton.cpp widgets/LevelPanToolButton.h |
diffstat | 2 files changed, 13 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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; };