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 } } diff --git a/Services/BarService.qml b/Services/BarService.qml index 9fc6749b..a459dee0 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 < widgets.length; i++) { + const widget = widgets[i] + if (widget.showVisualizer) { + hasAudioVisualizer = true + } + } + } + } + // Registry to store actual widget instances // Key format: "screenName|section|widgetId|index" property var widgetInstances: ({}) @@ -20,6 +41,9 @@ Singleton { "index": index, "instance": instance } + + timerCheckVisualizer.restart() + Logger.log("BarService", "Registered widget:", key) } diff --git a/Services/BarWidgetRegistry.qml b/Services/BarWidgetRegistry.qml index 074f362d..913286a6 100644 --- a/Services/BarWidgetRegistry.qml +++ b/Services/BarWidgetRegistry.qml @@ -15,6 +15,7 @@ Singleton { "Bluetooth": bluetoothComponent, "Brightness": brightnessComponent, "Clock": clockComponent, + "ControlCenter": controlCenterComponent, "CustomButton": customButtonComponent, "DarkMode": darkMode, "KeepAwake": keepAwakeComponent, @@ -24,9 +25,8 @@ Singleton { "NightLight": nightLightComponent, "NotificationHistory": notificationHistoryComponent, "PowerProfile": powerProfileComponent, - "SessionMenu": sessionMenuComponent, "ScreenRecorder": screenRecorderComponent, - "ControlCenter": controlCenterComponent, + "SessionMenu": sessionMenuComponent, "Spacer": spacerComponent, "SystemMonitor": systemMonitorComponent, "Taskbar": taskbarComponent, diff --git a/Services/CavaService.qml b/Services/CavaService.qml index cdc0c15b..1c03f6f1 100644 --- a/Services/CavaService.qml +++ b/Services/CavaService.qml @@ -8,9 +8,9 @@ import qs.Commons Singleton { id: root + property bool shouldRun: BarService.hasAudioVisualizer || (PanelService.getPanel("controlCenterPanel") === PanelService.openedPanel) property var values: Array(barsCount).fill(0) property int barsCount: 24 - property var config: ({ "general": { "bars": barsCount, @@ -37,8 +37,11 @@ Singleton { Process { id: process stdinEnabled: true - running: true // Yes, cava should run at all times! Even if no mpris is available. + running: root.shouldRun command: ["cava", "-p", "/dev/stdin"] + onRunningChanged: { + Logger.log("Cava", "Process running:", running) + } onExited: { stdinEnabled = true values = Array(barsCount).fill(0)