diff widgets/LevelPanToolButton.cpp @ 942:fcbfc7fad1f2 tonioni

Allow setting big-image size directly
author Chris Cannam
date Tue, 31 Mar 2015 14:46:32 +0100
parents 77110abca8a1
children 6a6a63506e3f
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