1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-04 12:52:06 -04:00

Add Notification Rules

- Additional right-click ops
- Allow for 3rd boy line on init notification popup
This commit is contained in:
purian23
2026-02-13 12:59:29 -05:00
committed by bbedward
parent be133b73c7
commit 9f13546b4d
6 changed files with 182 additions and 19 deletions

View File

@@ -749,7 +749,7 @@ Rectangle {
Menu {
id: notificationCardContextMenu
width: 220
width: 300
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
background: Rectangle {
@@ -760,7 +760,9 @@ Rectangle {
}
MenuItem {
text: I18n.tr("Mute popups for %1").arg(notificationGroup?.appName || I18n.tr("this app"))
id: muteUnmuteItem
readonly property bool isMuted: SettingsData.isAppMuted(notificationGroup?.appName || "", notificationGroup?.latestNotification?.desktopEntry || "")
text: isMuted ? I18n.tr("Unmute popups for %1").arg(notificationGroup?.appName || I18n.tr("this app")) : I18n.tr("Mute popups for %1").arg(notificationGroup?.appName || I18n.tr("this app"))
contentItem: StyledText {
text: parent.text
@@ -778,8 +780,12 @@ Rectangle {
onTriggered: {
const appName = notificationGroup?.appName || "";
const desktopEntry = notificationGroup?.latestNotification?.desktopEntry || "";
SettingsData.addMuteRuleForApp(appName, desktopEntry);
NotificationService.dismissGroup(notificationGroup?.key || "");
if (isMuted) {
SettingsData.removeMuteRuleForApp(appName, desktopEntry);
} else {
SettingsData.addMuteRuleForApp(appName, desktopEntry);
NotificationService.dismissGroup(notificationGroup?.key || "");
}
}
}