From 863c08978c860ea7698248a27f41867a1e134120 Mon Sep 17 00:00:00 2001 From: Corey Woodworth Date: Sun, 2 Nov 2025 23:00:29 -0500 Subject: [PATCH 1/3] committing files that won't stack --- Modules/Bar/Widgets/LockKeys.qml | 42 ++--- .../Bar/WidgetSettings/LockKeysSettings.qml | 146 ++++++++++++------ Services/BarWidgetRegistry.qml | 6 +- 3 files changed, 112 insertions(+), 82 deletions(-) diff --git a/Modules/Bar/Widgets/LockKeys.qml b/Modules/Bar/Widgets/LockKeys.qml index 3b356e85..cc1d7443 100644 --- a/Modules/Bar/Widgets/LockKeys.qml +++ b/Modules/Bar/Widgets/LockKeys.qml @@ -30,11 +30,14 @@ 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 + readonly property string capsIcon: widgetSettings.capsLockIcon !== undefined ? widgetSettings.capsLockIcon : widgetMetadata.capsLockIcon + readonly property string numIcon: widgetSettings.numLockIcon !== undefined ? widgetSettings.numLockIcon : widgetMetadata.numLockIcon + readonly property string scrollIcon: widgetSettings.scrollLockIcon !== undefined ? widgetSettings.scrollLockIcon : widgetMetadata.scrollLockIcon + implicitWidth: isVertical ? Style.capsuleHeight : Math.round(layout.implicitWidth + Style.marginM * 2) implicitHeight: isVertical ? Math.round(layout.implicitHeight + Style.marginM * 2) : Style.capsuleHeight @@ -51,8 +54,6 @@ 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 @@ -60,17 +61,17 @@ Rectangle { NIcon { visible: root.showCaps - icon: layout.indicatorStyle[0] + icon: root.capsIcon color: LockKeysService.capsLockOn ? Color.mTertiary : Qt.alpha(Color.mOnSurfaceVariant, 0.3) } NIcon { visible: root.showNum - icon: layout.indicatorStyle[1] + icon: root.numIcon color: LockKeysService.numLockOn ? Color.mTertiary : Qt.alpha(Color.mOnSurfaceVariant, 0.3) } NIcon { visible: root.showScroll - icon: layout.indicatorStyle[2] + icon: root.scrollIcon color: LockKeysService.scrollLockOn ? Color.mTertiary : Qt.alpha(Color.mOnSurfaceVariant, 0.3) } } @@ -82,42 +83,19 @@ Rectangle { NIcon { visible: root.showCaps - icon: layout.indicatorStyle[0] + icon: root.capsIcon color: LockKeysService.capsLockOn ? Color.mTertiary : Qt.alpha(Color.mOnSurfaceVariant, 0.3) } NIcon { visible: root.showNum - icon: layout.indicatorStyle[1] + icon: root.numIcon color: LockKeysService.numLockOn ? Color.mTertiary : Qt.alpha(Color.mOnSurfaceVariant, 0.3) } NIcon { visible: root.showScroll - icon: layout.indicatorStyle[2] + icon: root.scrollIcon 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 541ce9d8..192ce1a3 100644 --- a/Modules/Settings/Bar/WidgetSettings/LockKeysSettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/LockKeysSettings.qml @@ -14,71 +14,121 @@ 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 + property string capsIcon: widgetData.capsLockIcon !== undefined ? widgetData.capsLockIcon : widgetMetadata.capsLockIcon + property string numIcon: widgetData.numLockIcon !== undefined ? widgetData.numLockIcon : widgetMetadata.numLockIcon + property string scrollIcon: widgetData.scrollLockIcon !== undefined ? widgetData.scrollLockIcon : widgetMetadata.scrollLockIcon + function saveSettings() { var settings = Object.assign({}, widgetData || {}) - settings.indicatorStyle = valueIndicatorStyle settings.showCapsLock = valueShowCapsLock settings.showNumLock = valueShowNumLock settings.showScrollLock = valueShowScrollLock + settings.capsLockIcon = capsIcon + settings.numLockIcon = numIcon + settings.scrollLockIcon = scrollIcon 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 + RowLayout { + spacing: Style.marginM + + 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") + checked: valueShowCapsLock + onToggled: checked => valueShowCapsLock = checked + } + + NIcon { + Layout.alignment: Qt.AlignVCenter + icon: capsIcon + pointSize: Style.fontSizeXL + visible: capsIcon !== "" + } + + NButton { + text: I18n.tr("bar.widget-settings.custom-button.browse") + onClicked: capsPicker.open() + enabled: valueShowCapsLock + } } - 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") - checked: valueShowCapsLock - onToggled: checked => valueShowCapsLock = checked + NIconPicker { + id: capsPicker + initialIcon: capsIcon + query: "letter-c" + onIconSelected: function (iconName) { + capsIcon = iconName + } } - NToggle { - label: I18n.tr("bar.widget-settings.lock-keys.show-num-lock.label") - description: I18n.tr("bar.widget-settings.lock-keys.show-num-lock.description") - checked: valueShowNumLock - onToggled: checked => valueShowNumLock = checked + RowLayout { + spacing: Style.marginM + + NToggle { + label: I18n.tr("bar.widget-settings.lock-keys.show-num-lock.label") + description: I18n.tr("bar.widget-settings.lock-keys.show-num-lock.description") + checked: valueShowNumLock + onToggled: checked => valueShowNumLock = checked + } + + NIcon { + Layout.alignment: Qt.AlignVCenter + icon: numIcon + pointSize: Style.fontSizeXL + visible: numIcon !== "" + } + + NButton { + text: I18n.tr("bar.widget-settings.custom-button.browse") + onClicked: numPicker.open() + enabled: valueShowNumLock + } } - NToggle { - label: I18n.tr("bar.widget-settings.lock-keys.show-scroll-lock.label") - description: I18n.tr("bar.widget-settings.lock-keys.show-scroll-lock.description") - checked: valueShowScrollLock - onToggled: checked => valueShowScrollLock = checked + NIconPicker { + id: numPicker + initialIcon: numIcon + query: "letter-n" + onIconSelected: function (iconName) { + numIcon = iconName + } + } + + RowLayout { + spacing: Style.marginM + + NToggle { + label: I18n.tr("bar.widget-settings.lock-keys.show-scroll-lock.label") + description: I18n.tr("bar.widget-settings.lock-keys.show-scroll-lock.description") + checked: valueShowScrollLock + onToggled: checked => valueShowScrollLock = checked + } + + NIcon { + Layout.alignment: Qt.AlignVCenter + icon: scrollIcon + pointSize: Style.fontSizeXL + visible: scrollIcon !== "" + } + + NButton { + text: I18n.tr("bar.widget-settings.custom-button.browse") + onClicked: scrollPicker.open() + enabled: valueShowScrollLock + } + } + + NIconPicker { + id: scrollPicker + initialIcon: scrollIcon + query: "letter-s" + onIconSelected: function (iconName) { + scrollIcon = iconName + } } } diff --git a/Services/BarWidgetRegistry.qml b/Services/BarWidgetRegistry.qml index b4425195..678e9ad8 100644 --- a/Services/BarWidgetRegistry.qml +++ b/Services/BarWidgetRegistry.qml @@ -101,10 +101,12 @@ Singleton { }, "LockKeys": { "allowUserSettings": true, - "indicatorStyle": "large", "showCapsLock": true, "showNumLock": true, - "showScrollLock": true + "showScrollLock": true, + "capsLockIcon": "letter-c", + "numLockIcon": "letter-n", + "scrollLockIcon": "letter-s", }, "MediaMini": { "allowUserSettings": true, From 8730f0bb1623e74c78786cf31166e9660067451e Mon Sep 17 00:00:00 2001 From: Corey Woodworth Date: Sun, 2 Nov 2025 23:15:47 -0500 Subject: [PATCH 2/3] Stacking changes and translations done --- Assets/Translations/de.json | 13 +----------- Assets/Translations/en.json | 21 +++++-------------- Assets/Translations/es.json | 13 +----------- Assets/Translations/fr.json | 13 +----------- Assets/Translations/pt.json | 13 +----------- Assets/Translations/zh-CN.json | 13 +----------- .../Bar/WidgetSettings/LockKeysSettings.qml | 6 +++--- 7 files changed, 13 insertions(+), 79 deletions(-) diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index f9224eef..aae6719d 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -1291,18 +1291,7 @@ "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" - } + "browse": "Durchsuchen" } } }, diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 76b87f64..fac2278f 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -1262,18 +1262,6 @@ } }, "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." @@ -1285,7 +1273,8 @@ "show-scroll-lock": { "label": "Scroll Lock", "description": "Display scroll lock status." - } + }, + "browse": "Browse" } } }, @@ -1456,9 +1445,9 @@ "colors": { "primary": "Primary", "secondary": "Secondary", - "tertiary": "Tertiary", - "error": "Error", - "onSurface": "On Surface" + "tertiary": "Tertiary", + "error": "Error", + "onSurface": "On Surface" }, "bar": { "position": { diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index 7252dbf9..f12e357f 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -1274,18 +1274,7 @@ "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" - } + "browse": "Navegar" } } }, diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index 1e0b879d..3eb65361 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -1274,18 +1274,7 @@ "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" - } + "browse": "Parcourir" } } }, diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index 7b3722cd..f10087de 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -1274,18 +1274,7 @@ "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" - } + "browse": "Navegar" } } }, diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index d107d181..78a2f4fa 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -1274,18 +1274,7 @@ "description": "显示滚动锁定状态。", "label": "滚动锁定" }, - "indicator-style": { - "hex": "六边形字母", - "large": "大写字母", - "small": "小写字母", - "square": "方块字", - "square-round": "圆角方形字母", - "circle": "圆圈字母", - "circle-dash": "虚线圆圈字母", - "circle-dot": "虚线圆圈字母", - "description": "锁键指示器的图标样式", - "label": "指标样式" - } + "browse": "浏览" } } }, diff --git a/Modules/Settings/Bar/WidgetSettings/LockKeysSettings.qml b/Modules/Settings/Bar/WidgetSettings/LockKeysSettings.qml index 192ce1a3..5ffbf55a 100644 --- a/Modules/Settings/Bar/WidgetSettings/LockKeysSettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/LockKeysSettings.qml @@ -51,7 +51,7 @@ ColumnLayout { } NButton { - text: I18n.tr("bar.widget-settings.custom-button.browse") + text: I18n.tr("bar.widget-settings.lock-keys.browsedd") onClicked: capsPicker.open() enabled: valueShowCapsLock } @@ -84,7 +84,7 @@ ColumnLayout { } NButton { - text: I18n.tr("bar.widget-settings.custom-button.browse") + text: I18n.tr("bar.widget-settings.lock-keys.browse") onClicked: numPicker.open() enabled: valueShowNumLock } @@ -117,7 +117,7 @@ ColumnLayout { } NButton { - text: I18n.tr("bar.widget-settings.custom-button.browse") + text: I18n.tr("bar.widget-settings.lock-keys.browse") onClicked: scrollPicker.open() enabled: valueShowScrollLock } From b044c6ddd1a82e9241505fc609465f97d6548001 Mon Sep 17 00:00:00 2001 From: MrDowntempo Date: Sun, 2 Nov 2025 23:26:29 -0500 Subject: [PATCH 3/3] Removed superfluous comma --- Services/BarWidgetRegistry.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Services/BarWidgetRegistry.qml b/Services/BarWidgetRegistry.qml index 678e9ad8..55214a5a 100644 --- a/Services/BarWidgetRegistry.qml +++ b/Services/BarWidgetRegistry.qml @@ -106,7 +106,7 @@ Singleton { "showScrollLock": true, "capsLockIcon": "letter-c", "numLockIcon": "letter-n", - "scrollLockIcon": "letter-s", + "scrollLockIcon": "letter-s" }, "MediaMini": { "allowUserSettings": true,