BarWidgetSettingsDialog: remove DND, rename Save to Apply

This commit is contained in:
Ly-sec 2025-09-07 15:20:24 +02:00
parent dc0ef93680
commit c14eb95dba

View file

@ -112,7 +112,7 @@ Popup {
}
NButton {
text: "Save"
text: "Apply"
onClicked: {
if (settingsLoader.item && settingsLoader.item.saveSettings) {
var newSettings = settingsLoader.item.saveSettings()
@ -186,14 +186,11 @@ Popup {
!== undefined ? settingsPopup.widgetData.showUnreadBadge : BarWidgetRegistry.widgetMetadata["NotificationHistory"].showUnreadBadge
property bool valueHideWhenZero: settingsPopup.widgetData.hideWhenZero
!== undefined ? settingsPopup.widgetData.hideWhenZero : BarWidgetRegistry.widgetMetadata["NotificationHistory"].hideWhenZero
// Stage DND locally; commit on Save
property bool valueDoNotDisturbGlobal: Settings.data.notifications.doNotDisturb
function saveSettings() {
var settings = Object.assign({}, settingsPopup.widgetData)
settings.showUnreadBadge = valueShowUnreadBadge
settings.hideWhenZero = valueHideWhenZero
Settings.data.notifications.doNotDisturb = valueDoNotDisturbGlobal
return settings
}
@ -208,13 +205,6 @@ Popup {
checked: valueHideWhenZero
onToggled: checked => valueHideWhenZero = checked
}
NCheckbox {
label: "Do Not Disturb (notifications)"
description: "Toggle notifications 'Do Not Disturb'"
checked: valueDoNotDisturbGlobal
onToggled: checked => valueDoNotDisturbGlobal = checked
}
}
}