fix: Toggle notification sound functionality

This commit is contained in:
Hannes
2026-08-28 12:41:31 +02:00
parent f2e8d8a144
commit 8352ba5a56
2 changed files with 12 additions and 11 deletions
+10 -10
View File
@@ -13,7 +13,7 @@ MouseArea {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
menuProc.running = true NotificationS.soundEnabled = !NotificationS.soundEnabled
} }
Rectangle { Rectangle {
@@ -24,18 +24,18 @@ MouseArea {
Text { Text {
id: notificationText id: notificationText
anchors.centerIn: parent anchors.centerIn: parent
text: Quickshell.iconPath("discord") // text: Quickshell.iconPath("discord")
// text: "󰂚" text: NotificationS.soundEnabled ? "󰂚" : "󰂛"
font.pixelSize: Config.bigIconSize(notificationButton.height) font.pixelSize: Config.bigIconSize(bar.height)
font.family: Config.font font.family: Config.font
color: Colors.secondaryContainer_fg color: Colors.secondaryContainer_fg
} }
Image{ // Image{
id: iconImage // id: iconImage
source: Quickshell.iconPath("discord") // source: Quickshell.iconPath("discord")
width: Config.bigIconSize(notificationButton.height) // width: Config.bigIconSize(notificationButton.height)
height: Config.bigIconSize(notificationButton.height) // height: Config.bigIconSize(notificationButton.height)
} // }
} }
} }
@@ -12,6 +12,7 @@ Item {
property var focusedMonitor: null property var focusedMonitor: null
property var newestNotification: null property var newestNotification: null
property bool soundEnabled: true
signal notificationReceived(var notification) signal notificationReceived(var notification)
@@ -81,7 +82,7 @@ Item {
onTriggered: { onTriggered: {
focusedMonitor = Hyprland.focusedMonitor focusedMonitor = Hyprland.focusedMonitor
notificationReceived(notification) notificationReceived(notification)
if(!notification.lastGeneration){ if(!notification.lastGeneration && notificationServerState.soundEnabled){
notificationSound.play() notificationSound.play()
} }