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:
Belal 2025-09-01 11:15:33 +03:00 committed by GitHub
parent a17b76dea1
commit 67f676d913
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -289,6 +289,23 @@ Item {
if (active?.canSeek && active?.positionSupported)
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 {