forked from Shinonome/dots-hyprland
aloow configuration of notif timeout duration
This commit is contained in:
@@ -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 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 JsonObject osd: JsonObject {
|
||||||
property int timeout: 1000
|
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 {
|
ContentSection {
|
||||||
icon: "side_navigation"
|
icon: "side_navigation"
|
||||||
title: Translation.tr("Sidebars")
|
title: Translation.tr("Sidebars")
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ Singleton {
|
|||||||
|
|
||||||
component NotifTimer: Timer {
|
component NotifTimer: Timer {
|
||||||
required property int notificationId
|
required property int notificationId
|
||||||
interval: 5000
|
interval: 7000
|
||||||
running: true
|
running: true
|
||||||
onTriggered: () => {
|
onTriggered: () => {
|
||||||
root.timeoutNotification(notificationId);
|
root.timeoutNotification(notificationId);
|
||||||
@@ -168,7 +168,7 @@ Singleton {
|
|||||||
if (notification.expireTimeout != 0) {
|
if (notification.expireTimeout != 0) {
|
||||||
newNotifObject.timer = notifTimerComponent.createObject(root, {
|
newNotifObject.timer = notifTimerComponent.createObject(root, {
|
||||||
"notificationId": newNotifObject.notificationId,
|
"notificationId": newNotifObject.notificationId,
|
||||||
"interval": notification.expireTimeout < 0 ? 5000 : notification.expireTimeout,
|
"interval": notification.expireTimeout < 0 ? (Config?.options.notifications.timeout ?? 7000) : notification.expireTimeout,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user