mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2025-12-06 06:36:15 +00:00
Add setting to disable keyboard layout toast
This commit is contained in:
@@ -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.",
|
||||
|
||||
@@ -350,6 +350,7 @@ Singleton {
|
||||
property int lowUrgencyDuration: 3
|
||||
property int normalUrgencyDuration: 8
|
||||
property int criticalUrgencyDuration: 15
|
||||
property bool enableKeyboardLayoutToast: true
|
||||
}
|
||||
|
||||
// on-screen display
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user