Mercurial > hg > svgui
diff 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 |
line wrap: on
line diff
--- a/widgets/Thumbwheel.cpp Wed Jun 13 09:19:33 2007 +0000 +++ b/widgets/Thumbwheel.cpp Wed Jun 13 10:27:39 2007 +0000 @@ -233,6 +233,21 @@ } void +Thumbwheel::scroll(bool up) +{ + int step = lrintf(m_speed); + if (step == 0) step = 1; + + if (up) { + setValue(m_value + step); + } else { + setValue(m_value - step); + } + + emit valueChanged(getValue()); +} + +void Thumbwheel::setSpeed(float speed) { m_speed = speed;