fix: Toggle notification sound functionality
This commit is contained in:
@@ -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)
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user