diff options
| author | Belal <belalkoko00@gmail.com> | 2025-09-01 11:15:33 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-01 18:15:33 +1000 |
| commit | 67f676d91308fab354230ffc3b8e156d865ddd3d (patch) | |
| tree | eb6af7ad0cdb291906064a3b6fde1b699e4732f1 /modules/dashboard | |
| parent | nix/hm: add systemd.target in home-manager (#532) (diff) | |
| download | caelestia-shell-67f676d91308fab354230ffc3b8e156d865ddd3d.tar.gz caelestia-shell-67f676d91308fab354230ffc3b8e156d865ddd3d.tar.bz2 caelestia-shell-67f676d91308fab354230ffc3b8e156d865ddd3d.zip | |
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>
Diffstat (limited to 'modules/dashboard')
| -rw-r--r-- | modules/dashboard/Media.qml | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/dashboard/Media.qml b/modules/dashboard/Media.qml index d2699a2..9c6ef16 100644 --- a/modules/dashboard/Media.qml +++ b/modules/dashboard/Media.qml @@ -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 { |