aloow configuration of notif timeout duration

This commit is contained in:
end-4
2025-09-20 10:47:09 +02:00
parent b9ae5cafa0
commit 3a01dad945
3 changed files with 22 additions and 2 deletions
@@ -266,6 +266,10 @@ Singleton {
property string userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"
}
property JsonObject notifications: JsonObject {
property int timeout: 7000
}
property JsonObject osd: JsonObject {
property int timeout: 1000
}
@@ -141,6 +141,22 @@ ContentPage {
}
}
ContentSection {
icon: "notifications"
title: Translation.tr("Notifications")
ConfigSpinBox {
text: Translation.tr("Timeout duration (if not defined by notification) (ms)")
value: Config.options.notifications.timeout
from: 1000
to: 60000
stepSize: 1000
onValueChanged: {
Config.options.notifications.timeout = value;
}
}
}
ContentSection {
icon: "side_navigation"
title: Translation.tr("Sidebars")
@@ -60,7 +60,7 @@ Singleton {
component NotifTimer: Timer {
required property int notificationId
interval: 5000
interval: 7000
running: true
onTriggered: () => {
root.timeoutNotification(notificationId);
@@ -168,7 +168,7 @@ Singleton {
if (notification.expireTimeout != 0) {
newNotifObject.timer = notifTimerComponent.createObject(root, {
"notificationId": newNotifObject.notificationId,
"interval": notification.expireTimeout < 0 ? 5000 : notification.expireTimeout,
"interval": notification.expireTimeout < 0 ? (Config?.options.notifications.timeout ?? 7000) : notification.expireTimeout,
});
}
}