aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/island/Island.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/island/Island.qml')
-rw-r--r--desktop/island/Island.qml15
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)
+ }
}