Mercurial > hg > svgui
comparison widgets/Thumbwheel.cpp @ 256:c492902dba40
* Make shift+mousewheel scroll vertically (where applicable) and alt+mousewheel
zoom vertically (where applicable). Closes #1734844
author | Chris Cannam |
---|---|
date | Wed, 13 Jun 2007 10:27:39 +0000 |
parents | e6d0b097d102 |
children | 846746e4e865 06b5f110c5d2 |
comparison
equal
deleted
inserted
replaced
255:e175ade2d6b0 | 256:c492902dba40 |
---|---|
231 setToolTip(text); | 231 setToolTip(text); |
232 } | 232 } |
233 } | 233 } |
234 | 234 |
235 void | 235 void |
236 Thumbwheel::scroll(bool up) | |
237 { | |
238 int step = lrintf(m_speed); | |
239 if (step == 0) step = 1; | |
240 | |
241 if (up) { | |
242 setValue(m_value + step); | |
243 } else { | |
244 setValue(m_value - step); | |
245 } | |
246 | |
247 emit valueChanged(getValue()); | |
248 } | |
249 | |
250 void | |
236 Thumbwheel::setSpeed(float speed) | 251 Thumbwheel::setSpeed(float speed) |
237 { | 252 { |
238 m_speed = speed; | 253 m_speed = speed; |
239 } | 254 } |
240 | 255 |