From 4c4ed4e3ce3dd25395866cb0bb71a8187f359dbe Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 11 Sep 2026 16:46:20 +0200 Subject: feat(volume-osd): show what is playing The OSD gains a track row above the volume bar when an MPRIS player is running: album art, title, artist, and prev/play/next. With no player it is the volume OSD it was, at the same size. A track change or a play/pause shows the panel as well, so the row is not something you only see by happening to touch the volume. Hovering freezes the fade so the buttons can be clicked and leaving restarts it, which keeps the passive behaviour intact for anyone not reaching for the mouse. The panel still takes no keyboard focus. playerctld proxies whichever player is active and republishes it under its own bus name, so every player is enumerated twice. Player.qml drops that name rather than deduplicating by identity, and controls the real player, which works whether or not playerctld is running. Album art is loaded with cache off and a per-track suffix on the URL. Audacious extracts embedded art into one temp file in its cache and rewrites that same path for each track, so the URL repeats while the image changes, and a cached Image would keep showing the last cover. Theme gains overlay, used by the art placeholder. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01G7NRsGyF9jGfPYS4zPqpN7 --- volume-osd/TransportButton.qml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 volume-osd/TransportButton.qml (limited to 'volume-osd/TransportButton.qml') diff --git a/volume-osd/TransportButton.qml b/volume-osd/TransportButton.qml new file mode 100644 index 0000000..07753b6 --- /dev/null +++ b/volume-osd/TransportButton.qml @@ -0,0 +1,38 @@ +// Copyright (C) 2026 Danilo M. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +import QtQuick + +Rectangle { + id: btn + property string glyph: "" + property bool enabled: true + signal clicked + + width: 30; height: 30; radius: 15 + color: area.containsMouse && enabled ? Qt.alpha(Theme.accent, 0.22) : "transparent" + opacity: enabled ? 1 : 0.35 + + Text { + anchors.centerIn: parent + text: btn.glyph + font { family: Theme.fontFamily; pixelSize: 14 } + color: Theme.text + } + + MouseArea { + id: area + anchors.fill: parent + hoverEnabled: true + cursorShape: btn.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor + onClicked: if (btn.enabled) btn.clicked() + } +} -- cgit v1.2.3