UI: smoother knobs

This updates knobs to feel smoother and allow the user to have finer
control over the value of the knob by multiplying the mouse drag delta
by a smoothness factor.

Also since it is significantly easier to point the knob where you want
it, I removed the magnet effect. This can easily be put back in; try it
out and see what you think.
This commit is contained in:
Andrew Kelley
2014-01-20 18:04:50 -05:00
parent 9e5ed88d25
commit 15e85494bd
2 changed files with 12 additions and 38 deletions

View File

@@ -148,12 +148,11 @@ private:
QPixmap * m_knobPixmap;
BoolModel m_volumeKnob;
float m_mouseOffset;
QPoint m_mouseOffset;
QPoint m_origMousePos;
float m_origValue;
bool m_buttonPressed;
int m_magneticDecay;
float m_totalAngle;
int m_angle;
QImage m_cache;