diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index bd572e3fd..12703d534 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -224,6 +224,10 @@ "display-mode": { "description": "Wählen Sie, wie dieser Wert angezeigt werden soll.", "label": "Anzeigemodus" + }, + "show-icon": { + "description": "Das Tastaturlayout-Symbol anzeigen.", + "label": "Symbol anzeigen" } }, "lock-keys": { diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 06daa4a7b..e2240cb90 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -224,6 +224,10 @@ "display-mode": { "description": "Choose how you'd like this value to appear.", "label": "Display mode" + }, + "show-icon": { + "description": "Display the keyboard layout icon.", + "label": "Show icon" } }, "lock-keys": { diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index 7daf5fdbc..32285afd7 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -224,6 +224,10 @@ "display-mode": { "description": "Elige cómo te gustaría que apareciera este valor.", "label": "Modo de visualización" + }, + "show-icon": { + "description": "Mostrar el icono de la distribución del teclado.", + "label": "Mostrar icono" } }, "lock-keys": { diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index 251d627d8..10e935953 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -224,6 +224,10 @@ "display-mode": { "description": "Choisissez comment vous souhaitez que cette valeur apparaisse.", "label": "Mode d'affichage" + }, + "show-icon": { + "description": "Afficher l'icône de disposition du clavier.", + "label": "Afficher l'icône" } }, "lock-keys": { diff --git a/Assets/Translations/hu.json b/Assets/Translations/hu.json index 716411ddb..4fd57fb13 100644 --- a/Assets/Translations/hu.json +++ b/Assets/Translations/hu.json @@ -224,6 +224,10 @@ "display-mode": { "description": "Válassza ki, hogyan jelenjen meg ez az érték.", "label": "Megjelenítési mód" + }, + "show-icon": { + "description": "Billentse a billentyűzetkiosztás ikont.", + "label": "Ikon megjelenítése" } }, "lock-keys": { diff --git a/Assets/Translations/ja.json b/Assets/Translations/ja.json index 1bf76b2d9..780a55204 100644 --- a/Assets/Translations/ja.json +++ b/Assets/Translations/ja.json @@ -224,6 +224,10 @@ "display-mode": { "description": "値の表示方法を選択します。", "label": "表示モード" + }, + "show-icon": { + "description": "キーボードレイアウトのアイコンを表示します。", + "label": "アイコンを表示 (Aikona o hyōji)" } }, "lock-keys": { diff --git a/Assets/Translations/ku.json b/Assets/Translations/ku.json index 2223c0286..391d4844e 100644 --- a/Assets/Translations/ku.json +++ b/Assets/Translations/ku.json @@ -224,6 +224,10 @@ "display-mode": { "description": "ka tu dixwaz ev nirx çawa xuya bibe hilbijêre.", "label": "Awaya nîşandanê" + }, + "show-icon": { + "description": "Nîşana şêweya klavyeyê nîşan bide.", + "label": "Nîşanê nîşan bide" } }, "lock-keys": { diff --git a/Assets/Translations/nl.json b/Assets/Translations/nl.json index 060e6a089..d47733499 100644 --- a/Assets/Translations/nl.json +++ b/Assets/Translations/nl.json @@ -224,6 +224,10 @@ "display-mode": { "description": "Kies hoe je wilt dat deze waarde wordt weergegeven.", "label": "Weergavemodus" + }, + "show-icon": { + "description": "Toon het toetsenbordindeling-icoon.", + "label": "Icoon weergeven" } }, "lock-keys": { diff --git a/Assets/Translations/pl.json b/Assets/Translations/pl.json index d95bb5ba5..935fa6bb6 100644 --- a/Assets/Translations/pl.json +++ b/Assets/Translations/pl.json @@ -224,6 +224,10 @@ "display-mode": { "description": "Wybierz sposób wyświetlania tej wartości.", "label": "Tryb wyświetlania" + }, + "show-icon": { + "description": "Wyświetl ikonę układu klawiatury.", + "label": "Pokaż ikonę" } }, "lock-keys": { diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index 6c0d27638..4e94cc6b7 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -224,6 +224,10 @@ "display-mode": { "description": "Escolha como você gostaria que este valor aparecesse.", "label": "Modo de exibição" + }, + "show-icon": { + "description": "Exibir o ícone do layout do teclado.", + "label": "Mostrar ícone" } }, "lock-keys": { diff --git a/Assets/Translations/ru.json b/Assets/Translations/ru.json index b8bcafe5a..78798abe2 100644 --- a/Assets/Translations/ru.json +++ b/Assets/Translations/ru.json @@ -224,6 +224,10 @@ "display-mode": { "description": "Выберите, как это значение должно отображаться.", "label": "Режим отображения" + }, + "show-icon": { + "description": "Отображать значок раскладки клавиатуры.", + "label": "Показать значок" } }, "lock-keys": { diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index b99cf581a..b21629927 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -224,6 +224,10 @@ "display-mode": { "description": "Bu değerin nasıl görünmesini istediğinizi seçin.", "label": "Görüntüleme modu" + }, + "show-icon": { + "description": "Klavye düzeni simgesini görüntüle.", + "label": "Simgeyi göster" } }, "lock-keys": { diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index de1ccff7c..e5c61b7dc 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -224,6 +224,10 @@ "display-mode": { "description": "Виберіть, як ви хочете, щоб це значення відображалося.", "label": "Режим відображення" + }, + "show-icon": { + "description": "Показувати піктограму розкладки клавіатури.", + "label": "Показати значок" } }, "lock-keys": { diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index 999525eaf..19de9d55c 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -224,6 +224,10 @@ "display-mode": { "description": "选择您希望此值显示的方式。", "label": "显示模式" + }, + "show-icon": { + "description": "显示键盘布局图标。", + "label": "显示图标" } }, "lock-keys": { diff --git a/Modules/Bar/Widgets/KeyboardLayout.qml b/Modules/Bar/Widgets/KeyboardLayout.qml index 43189b3e3..ea61c1a8d 100644 --- a/Modules/Bar/Widgets/KeyboardLayout.qml +++ b/Modules/Bar/Widgets/KeyboardLayout.qml @@ -33,6 +33,7 @@ Item { } readonly property string displayMode: (widgetSettings.displayMode !== undefined) ? widgetSettings.displayMode : widgetMetadata.displayMode + readonly property bool showIcon: (widgetSettings.showIcon !== undefined) ? widgetSettings.showIcon : widgetMetadata.showIcon // Use the shared service for keyboard layout property string currentLayout: KeyboardLayoutService.currentLayout @@ -70,14 +71,15 @@ Item { screen: root.screen density: Settings.data.bar.density oppositeDirection: BarService.getPillDirection(root) - icon: "keyboard" + icon: root.showIcon ? "keyboard" : "" autoHide: false // Important to be false so we can hover as long as we want text: currentLayout.toUpperCase() tooltipText: I18n.tr("tooltips.keyboard-layout", { "layout": currentLayout.toUpperCase() }) - forceOpen: root.displayMode === "forceOpen" - forceClose: root.displayMode === "alwaysHide" + // When icon is disabled, always show the layout text + forceOpen: !root.showIcon || root.displayMode === "forceOpen" + forceClose: root.showIcon && root.displayMode === "alwaysHide" onClicked: {} onRightClicked: { var popupMenuWindow = PanelService.getPopupMenuWindow(screen); diff --git a/Modules/Panels/Settings/Bar/WidgetSettings/KeyboardLayoutSettings.qml b/Modules/Panels/Settings/Bar/WidgetSettings/KeyboardLayoutSettings.qml index f39c11362..e9acf893e 100644 --- a/Modules/Panels/Settings/Bar/WidgetSettings/KeyboardLayoutSettings.qml +++ b/Modules/Panels/Settings/Bar/WidgetSettings/KeyboardLayoutSettings.qml @@ -14,14 +14,17 @@ ColumnLayout { // Local state property string valueDisplayMode: widgetData.displayMode !== undefined ? widgetData.displayMode : widgetMetadata.displayMode + property bool valueShowIcon: widgetData.showIcon !== undefined ? widgetData.showIcon : widgetMetadata.showIcon function saveSettings() { var settings = Object.assign({}, widgetData || {}); settings.displayMode = valueDisplayMode; + settings.showIcon = valueShowIcon; return settings; } NComboBox { + visible: valueShowIcon // Hide display mode setting when icon is disabled label: I18n.tr("bar.widget-settings.keyboard-layout.display-mode.label") description: I18n.tr("bar.widget-settings.keyboard-layout.display-mode.description") minimumWidth: 134 @@ -42,4 +45,11 @@ ColumnLayout { currentKey: valueDisplayMode onSelected: key => valueDisplayMode = key } + + NToggle { + label: I18n.tr("bar.widget-settings.keyboard-layout.show-icon.label") + description: I18n.tr("bar.widget-settings.keyboard-layout.show-icon.description") + checked: valueShowIcon + onToggled: checked => valueShowIcon = checked + } } diff --git a/Services/UI/BarWidgetRegistry.qml b/Services/UI/BarWidgetRegistry.qml index 945453243..19da99627 100644 --- a/Services/UI/BarWidgetRegistry.qml +++ b/Services/UI/BarWidgetRegistry.qml @@ -141,7 +141,8 @@ Singleton { } }, "KeyboardLayout": { - "displayMode": "onhover" + "displayMode": "onhover", + "showIcon": true }, "LockKeys": { "showCapsLock": true,