From 8352ba5a56e8ca57269333a17912092aec76f5a7 Mon Sep 17 00:00:00 2001 From: Hannes Date: Fri, 28 Aug 2026 12:41:31 +0200 Subject: [PATCH] fix: Toggle notification sound functionality --- modules/bar/widgets/NotificationButton.qml | 20 +++++++++---------- .../notificationServer/NotificationServer.qml | 3 ++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/modules/bar/widgets/NotificationButton.qml b/modules/bar/widgets/NotificationButton.qml index 2be5656..9326049 100644 --- a/modules/bar/widgets/NotificationButton.qml +++ b/modules/bar/widgets/NotificationButton.qml @@ -13,7 +13,7 @@ MouseArea { cursorShape: Qt.PointingHandCursor onClicked: { - menuProc.running = true + NotificationS.soundEnabled = !NotificationS.soundEnabled } Rectangle { @@ -24,18 +24,18 @@ MouseArea { Text { id: notificationText anchors.centerIn: parent - text: Quickshell.iconPath("discord") - // text: "󰂚" - font.pixelSize: Config.bigIconSize(notificationButton.height) + // text: Quickshell.iconPath("discord") + text: NotificationS.soundEnabled ? "󰂚" : "󰂛" + font.pixelSize: Config.bigIconSize(bar.height) font.family: Config.font color: Colors.secondaryContainer_fg } - Image{ - id: iconImage - source: Quickshell.iconPath("discord") - width: Config.bigIconSize(notificationButton.height) - height: Config.bigIconSize(notificationButton.height) - } + // Image{ + // id: iconImage + // source: Quickshell.iconPath("discord") + // width: Config.bigIconSize(notificationButton.height) + // height: Config.bigIconSize(notificationButton.height) + // } } } \ No newline at end of file diff --git a/modules/notification/notificationServer/NotificationServer.qml b/modules/notification/notificationServer/NotificationServer.qml index e807f7b..997ea56 100644 --- a/modules/notification/notificationServer/NotificationServer.qml +++ b/modules/notification/notificationServer/NotificationServer.qml @@ -12,6 +12,7 @@ Item { property var focusedMonitor: null property var newestNotification: null + property bool soundEnabled: true signal notificationReceived(var notification) @@ -81,7 +82,7 @@ Item { onTriggered: { focusedMonitor = Hyprland.focusedMonitor notificationReceived(notification) - if(!notification.lastGeneration){ + if(!notification.lastGeneration && notificationServerState.soundEnabled){ notificationSound.play() }