From b047837543f6082b7ef9e90b6abfc57295834af6 Mon Sep 17 00:00:00 2001 From: Corey Woodworth Date: Fri, 31 Oct 2025 01:17:50 -0400 Subject: [PATCH 1/2] Configurable Icons for the indications, and I18n. --- Assets/Translations/en.json | 12 ++++++ Modules/Bar/Widgets/LockKeys.qml | 39 +++++++++++++++---- .../Bar/WidgetSettings/LockKeysSettings.qml | 35 +++++++++++++++++ Services/BarWidgetRegistry.qml | 1 + 4 files changed, 80 insertions(+), 7 deletions(-) diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 74b2f2ec..271ac9c7 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -1258,6 +1258,18 @@ } }, "lock-keys": { + "indicator-style": { + "label": "Indicator Style", + "description": "Icon style for the lock key indicators", + "large": "Large Letters", + "small": "Small Letters", + "square": "Square Letters", + "square-round": "Rounded Squre Letters", + "circle": "Circle Letters", + "circle-dash": "Dashed Circle Letters", + "circle-dot": "Dotted Circle Letters", + "hex": "Hexagon Letters" + }, "show-caps-lock": { "label": "Caps Lock", "description": "Display caps lock status." diff --git a/Modules/Bar/Widgets/LockKeys.qml b/Modules/Bar/Widgets/LockKeys.qml index 952b310a..9d018aca 100644 --- a/Modules/Bar/Widgets/LockKeys.qml +++ b/Modules/Bar/Widgets/LockKeys.qml @@ -6,7 +6,6 @@ import qs.Commons import qs.Modules.Settings import qs.Services import qs.Widgets -//import qs.Modules.Bar.Extras Rectangle { id: root @@ -30,6 +29,7 @@ Rectangle { readonly property string barPosition: Settings.data.bar.position readonly property bool isVertical: barPosition === "left" || barPosition === "right" + readonly property string iconStyle: (widgetSettings.indicatorStyle !== undefined) ? widgetSettings.indicatorStyle : widgetMetadata.indicatorStyle readonly property bool showCaps: (widgetSettings.showCapsLock !== undefined) ? widgetSettings.showCapsLock : widgetMetadata.showCapsLock readonly property bool showNum: (widgetSettings.showNumLock !== undefined) ? widgetSettings.showNumLock : widgetMetadata.showNumLock readonly property bool showScroll: (widgetSettings.showScrollLock !== undefined) ? widgetSettings.showScrollLock : widgetMetadata.showScrollLock @@ -50,6 +50,8 @@ Rectangle { implicitWidth: rowLayout.visible ? rowLayout.implicitWidth : colLayout.implicitWidth implicitHeight: rowLayout.visible ? rowLayout.implicitHeight : colLayout.implicitHeight + readonly property var indicatorStyle: root.getIndicatorStyle(root.iconStyle) + RowLayout { id: rowLayout visible: !root.isVertical @@ -57,17 +59,17 @@ Rectangle { NIcon { visible: root.showCaps - icon: "letter-c" + icon: layout.indicatorStyle[0] color: LockKeysService.capsLockOn ? Color.mTertiary : Qt.alpha(Color.mOnSurfaceVariant, 0.3) } NIcon { visible: root.showNum - icon: "letter-n" + icon: layout.indicatorStyle[1] color: LockKeysService.numLockOn ? Color.mTertiary : Qt.alpha(Color.mOnSurfaceVariant, 0.3) } NIcon { visible: root.showScroll - icon: "letter-s" + icon: layout.indicatorStyle[2] color: LockKeysService.scrollLockOn ? Color.mTertiary : Qt.alpha(Color.mOnSurfaceVariant, 0.3) } } @@ -79,19 +81,42 @@ Rectangle { NIcon { visible: root.showCaps - icon: "letter-c" + icon: layout.indicatorStyle[0] color: LockKeysService.capsLockOn ? Color.mTertiary : Qt.alpha(Color.mOnSurfaceVariant, 0.3) } NIcon { visible: root.showNum - icon: "letter-n" + icon: layout.indicatorStyle[1] color: LockKeysService.numLockOn ? Color.mTertiary : Qt.alpha(Color.mOnSurfaceVariant, 0.3) } NIcon { visible: root.showScroll - icon: "letter-s" + icon: layout.indicatorStyle[2] color: LockKeysService.scrollLockOn ? Color.mTertiary : Qt.alpha(Color.mOnSurfaceVariant, 0.3) } } } + + function getIndicatorStyle(styleName) { + switch (styleName) { + case "large": + return ["letter-c", "letter-n", "letter-s"] + case "small": + return ["letter-c-small", "letter-n-small", "letter-s-small"] + case "square": + return ["square-letter-c", "square-letter-n", "square-letter-s"] + case "square-round": + return ["square-rounded-letter-c", "square-rounded-letter-n", "square-rounded-letter-s"] + case "circle": + return ["circle-letter-c", "circle-letter-n", "circle-letter-s"] + case "circle-dash": + return ["circle-dashed-letter-c", "circle-dashed-letter-n", "circle-dashed-letter-s"] + case "circle-dot": + return ["circle-dotted-letter-c", "circle-dotted-letter-n", "circle-dotted-letter-s"] + case "hex": + return ["hexagon-letter-c", "hexagon-letter-n", "hexagon-letter-s"] + default: + return ["letter-c", "letter-n", "letter-s"] + } + } } diff --git a/Modules/Settings/Bar/WidgetSettings/LockKeysSettings.qml b/Modules/Settings/Bar/WidgetSettings/LockKeysSettings.qml index fb32205b..1e043af8 100644 --- a/Modules/Settings/Bar/WidgetSettings/LockKeysSettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/LockKeysSettings.qml @@ -14,18 +14,53 @@ ColumnLayout { property var widgetMetadata: null // Local state + property string valueIndicatorStyle: widgetData.indicatorStyle !== undefined ? widgetData.indicatorStyle : widgetMetadata.indicatorStyle property bool valueShowCapsLock: widgetData.showCapsLock !== undefined ? widgetData.showCapsLock : widgetMetadata.showCapsLock property bool valueShowNumLock: widgetData.showNumLock !== undefined ? widgetData.showNumLock : widgetMetadata.showNumLock property bool valueShowScrollLock: widgetData.showScrollLock !== undefined ? widgetData.showScrollLock : widgetMetadata.showScrollLock function saveSettings() { var settings = Object.assign({}, widgetData || {}) + settings.indicatorStyle = valueIndicatorStyle settings.showCapsLock = valueShowCapsLock settings.showNumLock = valueShowNumLock settings.showScrollLock = valueShowScrollLock return settings } + NComboBox { + Layout.fillWidth: true + label: I18n.tr("bar.widget-settings.lock-keys.indicator-style.label") + description: I18n.tr("bar.widget-settings.lock-keys.indicator-style.description") + model: [{ + "key": "large", + "name": I18n.tr("bar.widget-settings.lock-keys.indicator-style.large") + }, { + "key": "small", + "name": I18n.tr("bar.widget-settings.lock-keys.indicator-style.small") + }, { + "key": "square", + "name": I18n.tr("bar.widget-settings.lock-keys.indicator-style.square") + }, { + "key": "square-round", + "name": I18n.tr("bar.widget-settings.lock-keys.indicator-style.square-round") + }, { + "key": "circle", + "name": I18n.tr("bar.widget-settings.lock-keys.indicator-style.circle") + }, { + "key": "circle-dash", + "name": I18n.tr("bar.widget-settings.lock-keys.indicator-style.circle-dash") + }, { + "key": "circle-dot", + "name": I18n.tr("bar.widget-settings.lock-keys.indicator-style.circle-dot") + }, { + "key": "hex", + "name": I18n.tr("bar.widget-settings.lock-keys.indicator-style.hex") + }] + currentKey: valueIndicatorStyle + onSelected: key => valueIndicatorStyle = key + } + NToggle { label: I18n.tr("bar.widget-settings.lock-keys.show-caps-lock.label") description: I18n.tr("bar.widget-settings.lock-keys.show-caps-lock.description") diff --git a/Services/BarWidgetRegistry.qml b/Services/BarWidgetRegistry.qml index dce92880..fcd6fdec 100644 --- a/Services/BarWidgetRegistry.qml +++ b/Services/BarWidgetRegistry.qml @@ -101,6 +101,7 @@ Singleton { }, "LockKeys": { "allowUserSettings": true, + "indicatorStyle": "large", "showCapsLock": true, "showNumLock": true, "showScrollLock": true From 0af85721b3492eb979c3a746d0c94fd90a80d6c1 Mon Sep 17 00:00:00 2001 From: Corey Woodworth Date: Fri, 31 Oct 2025 01:25:48 -0400 Subject: [PATCH 2/2] Finished Translation --- Assets/Translations/de.json | 12 ++++++++++++ Assets/Translations/es.json | 12 ++++++++++++ Assets/Translations/fr.json | 12 ++++++++++++ Assets/Translations/pt.json | 12 ++++++++++++ Assets/Translations/zh-CN.json | 12 ++++++++++++ 5 files changed, 60 insertions(+) diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index cb437dfd..fa06562c 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -1286,6 +1286,18 @@ "show-scroll-lock": { "description": "Scroll-Lock-Status anzeigen.", "label": "Rollenfeststelltaste" + }, + "indicator-style": { + "circle": "Kreisbuchstaben", + "circle-dash": "Gestrichelte Kreisbuchstaben", + "circle-dot": "Punktierte Kreisbuchstaben", + "description": "Symbolstil für die Feststelltastenanzeigen", + "hex": "Sechseck-Buchstaben", + "label": "Indikatorstil", + "large": "Große Buchstaben", + "small": "Kleinbuchstaben", + "square": "Quadratische Buchstaben", + "square-round": "Abgerundete quadratische Buchstaben" } } } diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index 07f3541b..e5643aa1 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -1269,6 +1269,18 @@ "show-scroll-lock": { "description": "Mostrar el estado de Bloq Despl.", "label": "Bloq Despl" + }, + "indicator-style": { + "circle": "Letras circulares", + "circle-dash": "Letras de círculo discontinuo", + "circle-dot": "Letras de círculo punteado", + "description": "Estilo de icono para los indicadores de las teclas de bloqueo", + "hex": "Letras hexagonales", + "label": "Estilo del indicador", + "large": "Letras grandes", + "small": "Letras minúsculas", + "square": "Letras cuadradas", + "square-round": "Letras cuadradas redondeadas" } } } diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index 286b567b..24183856 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -1269,6 +1269,18 @@ "show-scroll-lock": { "description": "Afficher l'état du verrouillage du défilement.", "label": "Verr Maj" + }, + "indicator-style": { + "circle": "Lettres circulaires", + "circle-dash": "Lettres en cercle pointillé", + "circle-dot": "Lettres en pointillés dans un cercle", + "description": "Style d'icône pour les indicateurs de la touche de verrouillage", + "hex": "Lettres hexagonales", + "label": "Style d'indicateur", + "large": "Grandes lettres", + "small": "Petites lettres", + "square": "Lettres carrées", + "square-round": "Lettres carrées arrondies" } } } diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index fb4eda66..a2939340 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -1269,6 +1269,18 @@ "show-scroll-lock": { "description": "Exibir o status do Scroll Lock.", "label": "Scroll Lock" + }, + "indicator-style": { + "circle": "Letras Circulares", + "circle-dash": "Letras em Círculo Tracejadas", + "circle-dot": "Letras de Círculo Pontilhado", + "description": "Estilo de ícone para os indicadores da tecla de bloqueio.", + "hex": "Letras Hexagonais", + "label": "Estilo do Indicador", + "large": "Letras grandes", + "small": "Letras minúsculas", + "square": "Letras Quadradas", + "square-round": "Letras Quadradas Arredondadas" } } } diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index 42586efd..db3dabd9 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -1269,6 +1269,18 @@ "show-scroll-lock": { "description": "显示滚动锁定状态。", "label": "滚动锁定" + }, + "indicator-style": { + "hex": "六边形字母", + "large": "大写字母", + "small": "小写字母", + "square": "方块字", + "square-round": "圆角方形字母", + "circle": "圆圈字母", + "circle-dash": "虚线圆圈字母", + "circle-dot": "虚线圆圈字母", + "description": "锁键指示器的图标样式", + "label": "指标样式" } } }