comparison widgets/LevelPanToolButton.cpp @ 1216:dc2af6616c83

Merge from branch 3.0-integration
author Chris Cannam
date Fri, 13 Jan 2017 10:29:50 +0000
parents 808d375a3b12
children 8ef67917c301
comparison
equal deleted inserted replaced
1048:e8102ff5573b 1216:dc2af6616c83
47 wa->setDefaultWidget(m_lpw); 47 wa->setDefaultWidget(m_lpw);
48 menu->addAction(wa); 48 menu->addAction(wa);
49 49
50 setPopupMode(InstantPopup); 50 setPopupMode(InstantPopup);
51 setMenu(menu); 51 setMenu(menu);
52 setToolTip(tr("Click to adjust level and pan"));
52 53
53 setImageSize(m_pixels); 54 setImageSize(m_pixels);
54 setBigImageSize(m_pixelsBig); 55 setBigImageSize(m_pixelsBig);
55 } 56 }
56 57
57 LevelPanToolButton::~LevelPanToolButton() 58 LevelPanToolButton::~LevelPanToolButton()
58 { 59 {
60 }
61
62 void
63 LevelPanToolButton::wheelEvent(QWheelEvent *e)
64 {
65 m_lpw->wheelEvent(e);
59 } 66 }
60 67
61 float 68 float
62 LevelPanToolButton::getLevel() const 69 LevelPanToolButton::getLevel() const
63 { 70 {
104 111
105 void 112 void
106 LevelPanToolButton::setPan(float pan) 113 LevelPanToolButton::setPan(float pan)
107 { 114 {
108 m_lpw->setPan(pan); 115 m_lpw->setPan(pan);
116 update();
117 }
118
119 void
120 LevelPanToolButton::setMonitoringLevels(float left, float right)
121 {
122 m_lpw->setMonitoringLevels(left, right);
109 update(); 123 update();
110 } 124 }
111 125
112 void 126 void
113 LevelPanToolButton::setIncludeMute(bool include) 127 LevelPanToolButton::setIncludeMute(bool include)
168 182
169 double margin = (double(height()) - m_pixels) / 2.0; 183 double margin = (double(height()) - m_pixels) / 2.0;
170 m_lpw->renderTo(this, QRectF(margin, margin, m_pixels, m_pixels), false); 184 m_lpw->renderTo(this, QRectF(margin, margin, m_pixels, m_pixels), false);
171 } 185 }
172 186
173 187 void
188 LevelPanToolButton::enterEvent(QEvent *e)
189 {
190 QToolButton::enterEvent(e);
191 emit mouseEntered();
192 }
193
194 void
195 LevelPanToolButton::leaveEvent(QEvent *e)
196 {
197 QToolButton::enterEvent(e);
198 emit mouseLeft();
199 }
200
201