dashboard/media: add scroll to seek (#528)
* dashboard/media: add scroll to seek * fix --------- Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
This commit is contained in:
parent
a17b76dea1
commit
67f676d913
1 changed files with 17 additions and 0 deletions
|
|
@ -289,6 +289,23 @@ Item {
|
||||||
if (active?.canSeek && active?.positionSupported)
|
if (active?.canSeek && active?.positionSupported)
|
||||||
active.position = value * active.length;
|
active.position = value * active.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CustomMouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
acceptedButtons: Qt.NoButton
|
||||||
|
|
||||||
|
function onWheel(event: WheelEvent) {
|
||||||
|
const active = Players.active;
|
||||||
|
if (!active?.canSeek || !active?.positionSupported)
|
||||||
|
return;
|
||||||
|
|
||||||
|
event.accepted = true;
|
||||||
|
const delta = event.angleDelta.y > 0 ? 10 : -10; // Time 10 seconds
|
||||||
|
Qt.callLater(() => {
|
||||||
|
active.position = Math.max(0, Math.min(active.length, active.position + delta));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue