From 6460b71aeef3f1e572f3b4904996fd07109e31b6 Mon Sep 17 00:00:00 2001
From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Date: Sun, 26 Jan 2025 14:47:19 +1100
Subject: media: bind controls sensitivity

---
 src/modules/popdowns/media.tsx | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

(limited to 'src/modules/popdowns/media.tsx')

diff --git a/src/modules/popdowns/media.tsx b/src/modules/popdowns/media.tsx
index 1f73cfa..2a50af6 100644
--- a/src/modules/popdowns/media.tsx
+++ b/src/modules/popdowns/media.tsx
@@ -43,19 +43,31 @@ const Player = ({ player }: { player: AstalMpris.Player }) => {
                     <label className="artist" label={bind(player, "artist").as(a => a ?? "")} />
                     <label className="album" label={bind(player, "album").as(a => a ?? "")} />
                     <box className="controls" halign={Gtk.Align.CENTER}>
-                        <button cursor="pointer" onClicked={() => player.shuffle()} sensitive={player.canControl}>
+                        <button
+                            cursor="pointer"
+                            onClicked={() => player.shuffle()}
+                            sensitive={bind(player, "canControl")}
+                        >
                             <icon icon={bind(player, "shuffleStatus").as(shuffleToIcon)} />
                         </button>
-                        <button cursor="pointer" onClicked={() => player.previous()} sensitive={player.canGoPrevious}>
+                        <button
+                            cursor="pointer"
+                            onClicked={() => player.previous()}
+                            sensitive={bind(player, "canGoPrevious")}
+                        >
                             <icon icon="caelestia-skip-previous-symbolic" />
                         </button>
-                        <button cursor="pointer" onClicked={() => player.play_pause()} sensitive={player.canControl}>
+                        <button
+                            cursor="pointer"
+                            onClicked={() => player.play_pause()}
+                            sensitive={bind(player, "canControl")}
+                        >
                             <icon icon={bind(player, "playbackStatus").as(playbackToIcon)} />
                         </button>
-                        <button cursor="pointer" onClicked={() => player.next()} sensitive={player.canGoNext}>
+                        <button cursor="pointer" onClicked={() => player.next()} sensitive={bind(player, "canGoNext")}>
                             <icon icon="caelestia-skip-next-symbolic" />
                         </button>
-                        <button cursor="pointer" onClicked={() => player.loop()} sensitive={player.canControl}>
+                        <button cursor="pointer" onClicked={() => player.loop()} sensitive={bind(player, "canControl")}>
                             <icon icon={bind(player, "loopStatus").as(loopToIcon)} />
                         </button>
                     </box>
-- 
cgit v1.2.3-freya

