mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-09 15:22:13 -04:00
notifications: Update Material 3 baselines
- New right-click to mute option - New independent Notification Animation settings
This commit is contained in:
@@ -501,6 +501,8 @@ Singleton {
|
||||
property int notificationTimeoutCritical: 0
|
||||
property bool notificationCompactMode: false
|
||||
property int notificationPopupPosition: SettingsData.Position.Top
|
||||
property int notificationAnimationSpeed: SettingsData.AnimationSpeed.Short
|
||||
property int notificationCustomAnimationDuration: 400
|
||||
property bool notificationHistoryEnabled: true
|
||||
property int notificationHistoryMaxCount: 50
|
||||
property int notificationHistoryMaxAgeDays: 7
|
||||
@@ -2152,6 +2154,24 @@ Singleton {
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
function addMuteRuleForApp(appName, desktopEntry) {
|
||||
var rules = JSON.parse(JSON.stringify(notificationRules || []));
|
||||
var pattern = (desktopEntry && desktopEntry !== "") ? desktopEntry : (appName || "");
|
||||
var field = (desktopEntry && desktopEntry !== "") ? "desktopEntry" : "appName";
|
||||
if (pattern === "")
|
||||
return;
|
||||
rules.push({
|
||||
enabled: true,
|
||||
field: field,
|
||||
pattern: pattern,
|
||||
matchType: "exact",
|
||||
action: "mute",
|
||||
urgency: "default"
|
||||
});
|
||||
notificationRules = rules;
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
function updateNotificationRule(index, ruleData) {
|
||||
var rules = JSON.parse(JSON.stringify(notificationRules || []));
|
||||
if (index < 0 || index >= rules.length)
|
||||
|
||||
@@ -776,6 +776,37 @@ Singleton {
|
||||
};
|
||||
}
|
||||
|
||||
readonly property int notificationAnimationBaseDuration: {
|
||||
if (typeof SettingsData === "undefined")
|
||||
return 200;
|
||||
if (SettingsData.notificationAnimationSpeed === SettingsData.AnimationSpeed.None)
|
||||
return 0;
|
||||
if (SettingsData.notificationAnimationSpeed === SettingsData.AnimationSpeed.Custom)
|
||||
return SettingsData.notificationCustomAnimationDuration;
|
||||
const presetMap = [0, 200, 400, 600];
|
||||
return presetMap[SettingsData.notificationAnimationSpeed] ?? 200;
|
||||
}
|
||||
|
||||
readonly property int notificationEnterDuration: {
|
||||
const base = notificationAnimationBaseDuration;
|
||||
return base === 0 ? 0 : Math.round(base * 0.875);
|
||||
}
|
||||
|
||||
readonly property int notificationExitDuration: {
|
||||
const base = notificationAnimationBaseDuration;
|
||||
return base === 0 ? 0 : Math.round(base * 0.75);
|
||||
}
|
||||
|
||||
readonly property int notificationExpandDuration: {
|
||||
const base = notificationAnimationBaseDuration;
|
||||
return base === 0 ? 0 : Math.round(base * 1.4);
|
||||
}
|
||||
|
||||
readonly property int notificationCollapseDuration: {
|
||||
const base = notificationAnimationBaseDuration;
|
||||
return base === 0 ? 0 : Math.round(base * 1.1);
|
||||
}
|
||||
|
||||
readonly property int popoutAnimationDuration: {
|
||||
if (typeof SettingsData === "undefined")
|
||||
return 150;
|
||||
|
||||
@@ -325,6 +325,8 @@ var SPEC = {
|
||||
notificationTimeoutCritical: { def: 0 },
|
||||
notificationCompactMode: { def: false },
|
||||
notificationPopupPosition: { def: 0 },
|
||||
notificationAnimationSpeed: { def: 1 },
|
||||
notificationCustomAnimationDuration: { def: 400 },
|
||||
notificationHistoryEnabled: { def: true },
|
||||
notificationHistoryMaxCount: { def: 50 },
|
||||
notificationHistoryMaxAgeDays: { def: 7 },
|
||||
|
||||
Reference in New Issue
Block a user