From 640a4339db26a6e017d67fa3f5d389595615fcdd Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Tue, 23 Sep 2025 08:37:16 -0400 Subject: [PATCH 1/3] Cava: Now only runs when a visualizer is in sight. --- Services/BarService.qml | 24 ++++++++++++++++++++++++ Services/BarWidgetRegistry.qml | 4 ++-- Services/CavaService.qml | 9 ++++++--- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/Services/BarService.qml b/Services/BarService.qml index 9fc6749b..96c5f2f1 100644 --- a/Services/BarService.qml +++ b/Services/BarService.qml @@ -1,11 +1,32 @@ pragma Singleton +import QtQuick import Quickshell import qs.Commons Singleton { id: root + property bool hasAudioVisualizer: false + + // Simple timer that run once when the widget structure has changed + // and determine if any MediaMini widget has the visualizer on + Timer { + id: timerCheckVisualizer + interval: 100 + repeat: false + onTriggered: { + hasAudioVisualizer = false + const widgets = getAllWidgetInstances("MediaMini") + for(var i=0; i Date: Tue, 23 Sep 2025 09:25:44 -0400 Subject: [PATCH 2/3] Autoformatting --- Modules/ControlCenter/Cards/MediaCard.qml | 20 ++++++++++---------- Services/BarService.qml | 2 +- Services/CavaService.qml | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Modules/ControlCenter/Cards/MediaCard.qml b/Modules/ControlCenter/Cards/MediaCard.qml index f5fa1889..5e4ad4f8 100644 --- a/Modules/ControlCenter/Cards/MediaCard.qml +++ b/Modules/ControlCenter/Cards/MediaCard.qml @@ -32,12 +32,12 @@ NBox { color: Color.mPrimary Layout.alignment: Qt.AlignHCenter } + // NText { // text: "No media player detected" // color: Color.mOnSurfaceVariant // Layout.alignment: Qt.AlignHCenter // } - Item { Layout.fillWidth: true Layout.fillHeight: true @@ -65,7 +65,7 @@ NBox { RowLayout { anchors.fill: parent spacing: Style.marginS * scaling - + NIcon { icon: "caret-down" font.pointSize: Style.fontSizeXXL * scaling @@ -92,12 +92,12 @@ NBox { var players = MediaService.getAvailablePlayers() for (var i = 0; i < players.length; i++) { menuItems.push({ - label: players[i].identity, - action: i.toString(), - icon: "disc", - enabled: true, - visible: true - }) + "label": players[i].identity, + "action": i.toString(), + "icon": "disc", + "enabled": true, + "visible": true + }) } playerContextMenu.model = menuItems playerContextMenu.openAtItem(playerSelectorButton, playerSelectorButton.width - playerContextMenu.width, playerSelectorButton.height) @@ -109,7 +109,7 @@ NBox { parent: root width: 200 * scaling - onTriggered: function(action) { + onTriggered: function (action) { var index = parseInt(action) if (!isNaN(index)) { MediaService.selectedPlayerIndex = index @@ -342,4 +342,4 @@ NBox { } } } -} \ No newline at end of file +} diff --git a/Services/BarService.qml b/Services/BarService.qml index 96c5f2f1..a459dee0 100644 --- a/Services/BarService.qml +++ b/Services/BarService.qml @@ -18,7 +18,7 @@ Singleton { onTriggered: { hasAudioVisualizer = false const widgets = getAllWidgetInstances("MediaMini") - for(var i=0; i Date: Tue, 23 Sep 2025 10:22:59 -0400 Subject: [PATCH 3/3] DockMenu: minor UI tweaks. --- Commons/TablerIcons.qml | 3 +++ Modules/Dock/DockMenu.qml | 21 ++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Commons/TablerIcons.qml b/Commons/TablerIcons.qml index d4eab0fd..75d8f0c6 100644 --- a/Commons/TablerIcons.qml +++ b/Commons/TablerIcons.qml @@ -56,6 +56,9 @@ Singleton { "keep-awake-on": "mug", "keep-awake-off": "mug-off", "disc": "disc-filled", + "eye": "eye", + "pin": "pin", + "unpin": "pinned-off", "image": "photo", "dark-mode": "contrast-filled", "camera-video": "video", diff --git a/Modules/Dock/DockMenu.qml b/Modules/Dock/DockMenu.qml index 5b8cebd9..ff4cfa78 100644 --- a/Modules/Dock/DockMenu.qml +++ b/Modules/Dock/DockMenu.qml @@ -93,7 +93,7 @@ PopupWindow { Rectangle { anchors.fill: parent - color: Color.mSurface + color: Color.mSurfaceVariant radius: Style.radiusS * scaling border.color: Color.mOutline border.width: Math.max(1, Style.borderS * scaling) @@ -128,14 +128,14 @@ PopupWindow { NIcon { icon: "eye" font.pointSize: Style.fontSizeL * scaling - color: activateMouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface + color: activateMouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurfaceVariant anchors.verticalCenter: parent.verticalCenter } NText { text: "Focus" font.pointSize: Style.fontSizeS * scaling - color: activateMouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface + color: activateMouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurfaceVariant anchors.verticalCenter: parent.verticalCenter } } @@ -150,7 +150,6 @@ PopupWindow { if (root.toplevel?.activate) { root.toplevel.activate() } - root.hide() root.requestClose() } } @@ -173,10 +172,10 @@ PopupWindow { icon: { if (!root.toplevel) return "pin" - return root.isAppPinned(root.toplevel.appId) ? "pinned-off" : "pin" + return root.isAppPinned(root.toplevel.appId) ? "unpin" : "pin" } font.pointSize: Style.fontSizeL * scaling - color: pinMouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface + color: pinMouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurfaceVariant anchors.verticalCenter: parent.verticalCenter } @@ -187,7 +186,7 @@ PopupWindow { return root.isAppPinned(root.toplevel.appId) ? "Unpin" : "Pin" } font.pointSize: Style.fontSizeS * scaling - color: pinMouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface + color: pinMouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurfaceVariant anchors.verticalCenter: parent.verticalCenter } } @@ -202,7 +201,7 @@ PopupWindow { if (root.toplevel?.appId) { root.toggleAppPin(root.toplevel.appId) } - root.hide() + //root.hide() root.requestClose() } } @@ -222,16 +221,16 @@ PopupWindow { spacing: Style.marginS * scaling NIcon { - icon: "x" + icon: "close" font.pointSize: Style.fontSizeL * scaling - color: closeMouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface + color: closeMouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurfaceVariant anchors.verticalCenter: parent.verticalCenter } NText { text: "Close" font.pointSize: Style.fontSizeS * scaling - color: closeMouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface + color: closeMouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurfaceVariant anchors.verticalCenter: parent.verticalCenter } }