comparison 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
comparison
equal deleted inserted replaced
941:d6acb8e36605 942:fcbfc7fad1f2
26 using std::endl; 26 using std::endl;
27 27
28 LevelPanToolButton::LevelPanToolButton(QWidget *parent) : 28 LevelPanToolButton::LevelPanToolButton(QWidget *parent) :
29 QToolButton(parent), 29 QToolButton(parent),
30 m_pixels(32), 30 m_pixels(32),
31 m_pixelsBig(32 * 3),
31 m_muted(false), 32 m_muted(false),
32 m_savedLevel(1.f) 33 m_savedLevel(1.f)
33 { 34 {
34 m_lpw = new LevelPanWidget(); 35 m_lpw = new LevelPanWidget();
35 36
48 49
49 setPopupMode(InstantPopup); 50 setPopupMode(InstantPopup);
50 setMenu(menu); 51 setMenu(menu);
51 52
52 setImageSize(m_pixels); 53 setImageSize(m_pixels);
54 setBigImageSize(m_pixelsBig);
53 } 55 }
54 56
55 LevelPanToolButton::~LevelPanToolButton() 57 LevelPanToolButton::~LevelPanToolButton()
56 { 58 {
57 } 59 }
80 m_pixels = pixels; 82 m_pixels = pixels;
81 83
82 QPixmap px(m_pixels, m_pixels); 84 QPixmap px(m_pixels, m_pixels);
83 px.fill(Qt::transparent); 85 px.fill(Qt::transparent);
84 setIcon(px); 86 setIcon(px);
87 }
85 88
86 m_lpw->setFixedWidth(m_pixels * 3); 89 void
87 m_lpw->setFixedHeight(m_pixels * 3); 90 LevelPanToolButton::setBigImageSize(int pixels)
91 {
92 m_pixelsBig = pixels;
93
94 m_lpw->setFixedWidth(m_pixelsBig);
95 m_lpw->setFixedHeight(m_pixelsBig);
88 } 96 }
89 97
90 void 98 void
91 LevelPanToolButton::setLevel(float level) 99 LevelPanToolButton::setLevel(float level)
92 { 100 {