diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-16 11:46:56 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-16 11:46:56 +0200 |
| commit | 39d3eb69555769d3216171ab7688e3e82bbf48d2 (patch) | |
| tree | b04f49bd92f083e6f876a6a8cb36617bfaf4549e /desktop/island/Island.qml | |
| parent | f200f7007272129bf59fef3e0b0e0a19f5bd362c (diff) | |
| download | quickshell-39d3eb69555769d3216171ab7688e3e82bbf48d2.tar.gz quickshell-39d3eb69555769d3216171ab7688e3e82bbf48d2.zip | |
feat(island): a media pill left of the clock
Shows album art and a scrolling "artist · album · title" while a
player is playing or paused, using the sound module's Player so the
browser proxy duplicates are already filtered. Hovering swaps the text
for a progress bar, swapped in place rather than growing the pill;
MPRIS does not push position, so it is re-read every second while
hovered, and a click seeks only when the player reports canSeek and a
known length. The wheel steps tracks one per notch, as the layout flag
does, so a touchpad does not skip several.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/island/Island.qml')
| -rw-r--r-- | desktop/island/Island.qml | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/desktop/island/Island.qml b/desktop/island/Island.qml index 8532652..3dbd36d 100644 --- a/desktop/island/Island.qml +++ b/desktop/island/Island.qml @@ -12,8 +12,10 @@ import Quickshell import Quickshell.Wayland import Quickshell.Hyprland +import Quickshell.Services.Mpris import QtQuick import ".." +import "../modules/sound" import "Logic.js" as Logic // The island: a sliver at the top centre of DP-1 that the two pills slide @@ -43,7 +45,7 @@ PanelWindow { // --- reveal and hide ------------------------------------------------- - readonly property bool hovered: sliverHit.containsMouse || clock.hovered || status.hovered + readonly property bool hovered: sliverHit.containsMouse || clock.hovered || status.hovered || media.hovered property bool shown: false // A tray menu is a separate popup: moving onto it un-hovers the pills, @@ -147,6 +149,7 @@ PanelWindow { item: sliverHit Region { item: clock; intersection: Intersection.Combine } Region { item: status; intersection: Intersection.Combine } + Region { item: media.visible ? media : null; intersection: Intersection.Combine } } // The visible sliver: neutral at rest, the capture colours while @@ -213,4 +216,14 @@ PanelWindow { onOpenSound: win.panel = win.panel === "sound" ? "" : "sound" onOpenDrawer: { win.panel = ""; win.drawer.show("sound"); } } + + // While something plays or is paused; it sits left of the clock pill and + // follows it as the calendar widens it. + MediaPill { + id: media + visible: Player.playing || Player.current?.playbackState === MprisPlaybackState.Paused + x: win.cx - width / 2 - (win.gap * 1.5 + clock.width + width / 2) * win.reveal + y: -height + (win.top + height) * win.reveal + opacity: Math.min(1, win.reveal * 2) + } } |
