Add setting to disable keyboard layout toast

This commit is contained in:
Ala Alkhafaji
2025-11-11 19:40:35 +01:00
parent 8aa4254d57
commit fe1129c56c
4 changed files with 36 additions and 4 deletions

View File

@@ -1389,6 +1389,16 @@
"label": "Monitors display"
}
},
"toast": {
"section": {
"description": "Configure toast appearance and behavior.",
"label": "Toast"
},
"enabled": {
"description": "Show a toast when the keyboard layout changes.",
"label": "Keyboard layout"
}
},
"settings": {
"always-on-top": {
"description": "Display notifications above fullscreen windows and other layers.",

View File

@@ -350,6 +350,7 @@ Singleton {
property int lowUrgencyDuration: 3
property int normalUrgencyDuration: 8
property int criticalUrgencyDuration: 15
property bool enableKeyboardLayoutToast: true
}
// on-screen display

View File

@@ -226,6 +226,25 @@ ColumnLayout {
}
}
}
NDivider {
Layout.fillWidth: true
Layout.topMargin: Style.marginL
Layout.bottomMargin: Style.marginL
}
// Toast Configuration
NHeader {
label: I18n.tr("settings.notifications.toast.section.label")
description: I18n.tr("settings.notifications.toast.section.description")
}
NToggle {
label: I18n.tr("settings.notifications.toast.enabled.label")
description: I18n.tr("settings.notifications.toast.enabled.description")
checked: Settings.data.notifications.enableKeyboardLayoutToast
onToggled: checked => Settings.data.notifications.enableKeyboardLayoutToast = checked
}
}
NDivider {

View File

@@ -57,10 +57,12 @@ Singleton {
const layoutChanged = isInitialized && currentLayout !== previousLayout && currentLayout !== I18n.tr("system.unknown-layout") && previousLayout !== "" && previousLayout !== I18n.tr("system.unknown-layout")
if (layoutChanged) {
const message = I18n.tr("toast.keyboard-layout.changed", {
"layout": currentLayout.toUpperCase()
})
ToastService.showNotice(message, "", "", 2000)
if (Settings.data.notifications.enableKeyboardLayoutToast) {
const message = I18n.tr("toast.keyboard-layout.changed", {
"layout": currentLayout.toUpperCase()
})
ToastService.showNotice(message, "", "", 2000)
}
Logger.d("KeyboardLayout", "Layout changed from", previousLayout, "to", currentLayout)
}