From 39d3eb69555769d3216171ab7688e3e82bbf48d2 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 16 Oct 2026 11:46:56 +0200 Subject: feat(island): a media pill left of the clock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- desktop/island/Island.qml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'desktop/island/Island.qml') 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) + } } -- cgit v1.2.3