Browse Source

qt: fix middle mouse wheel rewind issue

pull/201/head
Ojus Chugh 6 months ago
committed by Steve Lhomme
parent
commit
97cfb21b08
  1. 34
      modules/gui/qt/player/qml/SliderBar.qml

34
modules/gui/qt/player/qml/SliderBar.qml

@ -276,6 +276,40 @@ T.ProgressBar {
}
}
}
WheelHandler {
orientation: Qt.Vertical | Qt.Horizontal
acceptedDevices: PointerDevice.AllDevices
onWheel: (wheel) => {
wheelToVLC.qmlWheelEvent(wheel)
wheel.accepted = true
}
}
WheelToVLCConverter {
id: wheelToVLC
function handleVertical(steps: int) {
if (steps > 0)
Player.jumpFwd()
else
Player.jumpBwd()
}
function handleHorizontal(steps: int) {
if (steps > 0)
Player.jumpBwd()
else
Player.jumpFwd()
}
Component.onCompleted: {
wheelUpDown.connect(wheelToVLC, wheelToVLC.handleVertical)
wheelLeftRight.connect(wheelToVLC, wheelToVLC.handleHorizontal)
}
}
}
background: Item {

Loading…
Cancel
Save