diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index fccdafcd..c70a0c94 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -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.", diff --git a/Commons/Settings.qml b/Commons/Settings.qml index 81063cf2..f69c2912 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -350,6 +350,7 @@ Singleton { property int lowUrgencyDuration: 3 property int normalUrgencyDuration: 8 property int criticalUrgencyDuration: 15 + property bool enableKeyboardLayoutToast: true } // on-screen display diff --git a/Modules/Panels/Settings/Tabs/NotificationsTab.qml b/Modules/Panels/Settings/Tabs/NotificationsTab.qml index 189e7038..bc01d466 100644 --- a/Modules/Panels/Settings/Tabs/NotificationsTab.qml +++ b/Modules/Panels/Settings/Tabs/NotificationsTab.qml @@ -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 { diff --git a/Services/Keyboard/KeyboardLayoutService.qml b/Services/Keyboard/KeyboardLayoutService.qml index c449d300..d9043c8b 100644 --- a/Services/Keyboard/KeyboardLayoutService.qml +++ b/Services/Keyboard/KeyboardLayoutService.qml @@ -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) }