mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-01 19:18:28 -04:00
Add option to ignore app-requested notification timeout (#2909)
* Add option to ignore app-requested notification timeout Notifications may include an expireTimeout hint that currently takes precedence over the configured Low/Normal/Critical durations, so popups can disappear earlier (or later) than expected with no interaction involved. Add notificationIgnoreAppTimeout (default off, matching the notification spec) to let users force their own durations regardless of what the app requests. * Update settings search index for new timeout override toggle
This commit is contained in:
@@ -934,6 +934,7 @@ Singleton {
|
|||||||
property int notificationTimeoutLow: 5000
|
property int notificationTimeoutLow: 5000
|
||||||
property int notificationTimeoutNormal: 5000
|
property int notificationTimeoutNormal: 5000
|
||||||
property int notificationTimeoutCritical: 0
|
property int notificationTimeoutCritical: 0
|
||||||
|
property bool notificationIgnoreAppTimeout: false
|
||||||
property bool notificationCompactMode: false
|
property bool notificationCompactMode: false
|
||||||
property bool notificationShowTimeoutBar: false
|
property bool notificationShowTimeoutBar: false
|
||||||
property bool notificationDedupeEnabled: true
|
property bool notificationDedupeEnabled: true
|
||||||
|
|||||||
@@ -495,6 +495,7 @@ var SPEC = {
|
|||||||
notificationTimeoutLow: { def: 5000 },
|
notificationTimeoutLow: { def: 5000 },
|
||||||
notificationTimeoutNormal: { def: 5000 },
|
notificationTimeoutNormal: { def: 5000 },
|
||||||
notificationTimeoutCritical: { def: 0 },
|
notificationTimeoutCritical: { def: 0 },
|
||||||
|
notificationIgnoreAppTimeout: { def: false },
|
||||||
notificationCompactMode: { def: false },
|
notificationCompactMode: { def: false },
|
||||||
notificationShowTimeoutBar: { def: false },
|
notificationShowTimeoutBar: { def: false },
|
||||||
notificationDedupeEnabled: { def: true },
|
notificationDedupeEnabled: { def: true },
|
||||||
|
|||||||
@@ -844,6 +844,15 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
settingKey: "notificationIgnoreAppTimeout"
|
||||||
|
tags: ["notification", "timeout", "expire", "app", "override", "duration"]
|
||||||
|
text: I18n.tr("Ignore App-Requested Timeout")
|
||||||
|
description: I18n.tr("Always use the durations above, even if an app requests a shorter or longer one")
|
||||||
|
checked: SettingsData.notificationIgnoreAppTimeout
|
||||||
|
onToggled: checked => SettingsData.set("notificationIgnoreAppTimeout", checked)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsCard {
|
SettingsCard {
|
||||||
|
|||||||
@@ -777,7 +777,7 @@ Singleton {
|
|||||||
return 5000;
|
return 5000;
|
||||||
// expireTimeout is in milliseconds; -1 defers to our settings.
|
// expireTimeout is in milliseconds; -1 defers to our settings.
|
||||||
const appTimeout = wrapper.notification.expireTimeout;
|
const appTimeout = wrapper.notification.expireTimeout;
|
||||||
if (appTimeout >= 0)
|
if (appTimeout >= 0 && !SettingsData.notificationIgnoreAppTimeout)
|
||||||
return Math.round(appTimeout);
|
return Math.round(appTimeout);
|
||||||
switch (wrapper.urgency) {
|
switch (wrapper.urgency) {
|
||||||
case NotificationUrgency.Low:
|
case NotificationUrgency.Low:
|
||||||
|
|||||||
@@ -6122,6 +6122,34 @@
|
|||||||
"icon": "history",
|
"icon": "history",
|
||||||
"description": "Save dismissed notifications to history"
|
"description": "Save dismissed notifications to history"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"section": "notificationIgnoreAppTimeout",
|
||||||
|
"label": "Ignore App-Requested Timeout",
|
||||||
|
"tabIndex": 17,
|
||||||
|
"category": "Notifications",
|
||||||
|
"keywords": [
|
||||||
|
"above",
|
||||||
|
"alerts",
|
||||||
|
"always",
|
||||||
|
"app",
|
||||||
|
"duration",
|
||||||
|
"durations",
|
||||||
|
"even",
|
||||||
|
"expire",
|
||||||
|
"ignore",
|
||||||
|
"longer",
|
||||||
|
"messages",
|
||||||
|
"notification",
|
||||||
|
"notifications",
|
||||||
|
"override",
|
||||||
|
"requested",
|
||||||
|
"requests",
|
||||||
|
"shorter",
|
||||||
|
"timeout",
|
||||||
|
"toast"
|
||||||
|
],
|
||||||
|
"description": "Always use the durations above, even if an app requests a shorter or longer one"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"section": "lockScreenNotifications",
|
"section": "lockScreenNotifications",
|
||||||
"label": "Lock Screen",
|
"label": "Lock Screen",
|
||||||
@@ -6515,18 +6543,26 @@
|
|||||||
"tabIndex": 17,
|
"tabIndex": 17,
|
||||||
"category": "Notifications",
|
"category": "Notifications",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
"above",
|
||||||
"alerts",
|
"alerts",
|
||||||
|
"always",
|
||||||
"duration",
|
"duration",
|
||||||
|
"durations",
|
||||||
|
"even",
|
||||||
|
"longer",
|
||||||
"low",
|
"low",
|
||||||
"messages",
|
"messages",
|
||||||
"notification",
|
"notification",
|
||||||
"notifications",
|
"notifications",
|
||||||
"priority",
|
"priority",
|
||||||
|
"requests",
|
||||||
|
"shorter",
|
||||||
"timeout",
|
"timeout",
|
||||||
"timeouts",
|
"timeouts",
|
||||||
"toast"
|
"toast"
|
||||||
],
|
],
|
||||||
"icon": "timer"
|
"icon": "timer",
|
||||||
|
"description": "Always use the durations above, even if an app requests a shorter or longer one"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"section": "osdAlwaysShowValue",
|
"section": "osdAlwaysShowValue",
|
||||||
|
|||||||
Reference in New Issue
Block a user