updated clock module: added animations and removed redundancies
This commit is contained in:
@@ -402,6 +402,14 @@ Rectangle {
|
||||
onPressed: pos => sliderItem.seek(pos.x)
|
||||
onPositionChanged: pos => { if (pressed) sliderItem.seek(pos.x) }
|
||||
}
|
||||
WheelHandler {
|
||||
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||||
onWheel: event => {
|
||||
const step = 2
|
||||
const delta = event.angleDelta.y > 0 ? step : -step
|
||||
vs.sliderMoved(Math.max(0, Math.min(vs.maxVolume, vs.volume + delta)))
|
||||
}
|
||||
}
|
||||
function seek(x) {
|
||||
let ratio = Math.max(0.0, Math.min(1.0, x / sliderItem.width))
|
||||
vs.sliderMoved(Math.round(ratio * vs.maxVolume))
|
||||
|
||||
Reference in New Issue
Block a user