From 852ba5309290c37cc72dd87c862069a4f6c249ff Mon Sep 17 00:00:00 2001 From: Damocles Date: Thu, 16 Apr 2026 00:19:06 +0200 Subject: [PATCH] revert clock minText, hide volume outputs when single device --- modules/Clock.qml | 1 - modules/Volume.qml | 105 ++++++++++++++++++++++++--------------------- 2 files changed, 55 insertions(+), 51 deletions(-) diff --git a/modules/Clock.qml b/modules/Clock.qml index 9ceeb6e..6506124 100644 --- a/modules/Clock.qml +++ b/modules/Clock.qml @@ -10,6 +10,5 @@ M.BarLabel { font.pixelSize: M.Theme.fontSize + 1 label: Qt.formatDateTime(clock.date, "ddd, dd. MMM HH:mm") - minText: "Mi., 00. Sep. 00:00" tooltip: Qt.formatDateTime(clock.date, "dddd, dd. MMMM yyyy\nHH:mm:ss") } diff --git a/modules/Volume.qml b/modules/Volume.qml index ed4088b..3283ed7 100644 --- a/modules/Volume.qml +++ b/modules/Volume.qml @@ -195,65 +195,70 @@ M.BarSection { id: deviceList width: parent.width - // Output devices - Rectangle { - width: parent.width - 16 - height: 1 - anchors.horizontalCenter: parent.horizontalCenter - color: M.Theme.base03 - } - - Text { + // Output devices — only shown when more than one exists + Column { + visible: root._sinkList.length > 1 width: parent.width - height: 24 - verticalAlignment: Text.AlignVCenter - leftPadding: 12 - text: "Output Devices" - color: M.Theme.base04 - font.pixelSize: M.Theme.fontSize - 1 - font.family: M.Theme.fontFamily - } - Repeater { - model: root._sinkList + Rectangle { + width: parent.width - 16 + height: 1 + anchors.horizontalCenter: parent.horizontalCenter + color: M.Theme.base03 + } - delegate: Item { - required property var modelData + Text { + width: parent.width + height: 24 + verticalAlignment: Text.AlignVCenter + leftPadding: 12 + text: "Output Devices" + color: M.Theme.base04 + font.pixelSize: M.Theme.fontSize - 1 + font.family: M.Theme.fontFamily + } - width: deviceList.width - height: 28 + Repeater { + model: root._sinkList - readonly property bool _active: modelData === root.sink + delegate: Item { + required property var modelData - Rectangle { - anchors.fill: parent - anchors.leftMargin: 4 - anchors.rightMargin: 4 - color: deviceHover.hovered ? M.Theme.base02 : "transparent" - radius: M.Theme.radius - } + width: deviceList.width + height: 28 - Text { - anchors.left: parent.left - anchors.leftMargin: 12 - anchors.right: parent.right - anchors.rightMargin: 12 - anchors.verticalCenter: parent.verticalCenter - text: modelData.description || modelData.name || "Unknown" - color: parent._active ? root.accentColor : M.Theme.base05 - font.pixelSize: M.Theme.fontSize - font.family: M.Theme.fontFamily - font.bold: parent._active - elide: Text.ElideRight - } + readonly property bool _active: modelData === root.sink - HoverHandler { - id: deviceHover - cursorShape: Qt.PointingHandCursor - } + Rectangle { + anchors.fill: parent + anchors.leftMargin: 4 + anchors.rightMargin: 4 + color: deviceHover.hovered ? M.Theme.base02 : "transparent" + radius: M.Theme.radius + } - TapHandler { - onTapped: Pipewire.preferredDefaultAudioSink = modelData + Text { + anchors.left: parent.left + anchors.leftMargin: 12 + anchors.right: parent.right + anchors.rightMargin: 12 + anchors.verticalCenter: parent.verticalCenter + text: modelData.description || modelData.name || "Unknown" + color: parent._active ? root.accentColor : M.Theme.base05 + font.pixelSize: M.Theme.fontSize + font.family: M.Theme.fontFamily + font.bold: parent._active + elide: Text.ElideRight + } + + HoverHandler { + id: deviceHover + cursorShape: Qt.PointingHandCursor + } + + TapHandler { + onTapped: Pipewire.preferredDefaultAudioSink = modelData + } } } }