From 8331d1954d9cd23c058307875ebea1d7f23ba59a Mon Sep 17 00:00:00 2001 From: shouya <526598+shouya@users.noreply.github.com> Date: Fri, 21 Nov 2025 14:49:31 +0900 Subject: [PATCH 01/16] show workspaces for the focused screen --- Modules/Bar/Widgets/Workspace.qml | 13 ++++++++++++- .../Bar/WidgetSettings/WorkspaceSettings.qml | 9 +++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index 325f1a7e..680ca2df 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -46,6 +46,7 @@ Item { readonly property string labelMode: (widgetSettings.labelMode !== undefined) ? widgetSettings.labelMode : widgetMetadata.labelMode readonly property bool hideUnoccupied: (widgetSettings.hideUnoccupied !== undefined) ? widgetSettings.hideUnoccupied : widgetMetadata.hideUnoccupied + readonly property bool showFocusedScreen: (widgetSettings.showFocusedScreen !== undefined) ? widgetSettings.showFocusedScreen : widgetMetadata.showFocusedScreen readonly property int characterCount: isVertical ? 2 : ((widgetSettings.characterCount !== undefined) ? widgetSettings.characterCount : widgetMetadata.characterCount) property bool isDestroying: false @@ -162,10 +163,20 @@ Item { function refreshWorkspaces() { localWorkspaces.clear(); + + var focusedOutput = null; + if (showFocusedScreen) { + for (var i = 0; i < CompositorService.workspaces.count; i++) { + const ws = CompositorService.workspaces.get(i); + if (ws.isFocused) focusedOutput = ws.output.toLowerCase(); + } + } + if (screen !== null) { for (var i = 0; i < CompositorService.workspaces.count; i++) { const ws = CompositorService.workspaces.get(i); - if (ws.output.toLowerCase() === screen.name.toLowerCase()) { + if ((showFocusedScreen && ws.output.toLowerCase() == focusedOutput) || + (!showFocusedScreen && ws.output.toLowerCase() == screen.name.toLowerCase())) { if (hideUnoccupied && !ws.isOccupied && !ws.isFocused) { continue; } diff --git a/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml b/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml index 0c702563..dfb4ef84 100644 --- a/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml +++ b/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml @@ -14,6 +14,7 @@ ColumnLayout { property string valueLabelMode: widgetData.labelMode !== undefined ? widgetData.labelMode : widgetMetadata.labelMode property bool valueHideUnoccupied: widgetData.hideUnoccupied !== undefined ? widgetData.hideUnoccupied : widgetMetadata.hideUnoccupied + property bool valueShowFocusedScreen: widgetData.showFocusedScreen !== undefined ? widgetData.showFocusedScreen : widgetMetadata.showFocusedScreen property int valueCharacterCount: widgetData.characterCount !== undefined ? widgetData.characterCount : widgetMetadata.characterCount function saveSettings() { @@ -21,6 +22,7 @@ ColumnLayout { settings.labelMode = valueLabelMode; settings.hideUnoccupied = valueHideUnoccupied; settings.characterCount = valueCharacterCount; + settings.showFocusedScreen = valueShowFocusedScreen; return settings; } @@ -51,6 +53,13 @@ ColumnLayout { minimumWidth: 200 } + NToggle { + label: I18n.tr("bar.widget-settings.workspace.show-focused-screen.label") + description: I18n.tr("bar.widget-settings.workspace.show-focused-screen.description") + checked: valueShowFocusedScreen + onToggled: checked => valueShowFocusedScreen = checked + } + NToggle { label: I18n.tr("bar.widget-settings.workspace.hide-unoccupied.label") description: I18n.tr("bar.widget-settings.workspace.hide-unoccupied.description") From bcebaa018550a823afca075326673d60c9bb21a6 Mon Sep 17 00:00:00 2001 From: shouya <526598+shouya@users.noreply.github.com> Date: Fri, 21 Nov 2025 14:52:20 +0900 Subject: [PATCH 02/16] add english translation --- Assets/Translations/en.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 8f2fcbef..3d1f5926 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -352,6 +352,10 @@ "description": "Don't display workspaces without windows.", "label": "Hide unoccupied" }, + "show-focused-screen": { + "description": "Show workspaces from the focused screen instead of from the same screen as the bar.", + "label": "Show focused screen" + }, "label-mode": { "description": "Choose how workspace labels are displayed.", "label": "Label Mode" From 211a9e4033fbdc9c27697218854980dda9e1ef0c Mon Sep 17 00:00:00 2001 From: shouya <526598+shouya@users.noreply.github.com> Date: Fri, 21 Nov 2025 14:53:51 +0900 Subject: [PATCH 03/16] add translations for other languages --- Assets/Translations/de.json | 4 ++++ Assets/Translations/es.json | 4 ++++ Assets/Translations/fr.json | 4 ++++ Assets/Translations/nl.json | 4 ++++ Assets/Translations/pt.json | 4 ++++ Assets/Translations/ru.json | 4 ++++ Assets/Translations/tr.json | 4 ++++ Assets/Translations/uk-UA.json | 4 ++++ Assets/Translations/zh-CN.json | 4 ++++ 9 files changed, 36 insertions(+) diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index 367205ab..0f41b4ec 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -352,6 +352,10 @@ "description": "Arbeitsbereiche ohne Fenster nicht anzeigen.", "label": "Unbesetzte ausblenden" }, + "show-focused-screen": { + "description": "Arbeitsbereiche vom fokussierten Bildschirm anzeigen, anstatt vom gleichen Bildschirm wie die Leiste.", + "label": "Fokussierten Bildschirm anzeigen" + }, "label-mode": { "description": "Wählen Sie, wie Arbeitsbereichs-Beschriftungen angezeigt werden.", "label": "Beschriftungsmodus" diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index 58cb8ff1..e8a0818e 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -352,6 +352,10 @@ "description": "No mostrar espacios de trabajo sin ventanas.", "label": "Ocultar desocupados" }, + "show-focused-screen": { + "description": "Mostrar espacios de trabajo de la pantalla enfocada en lugar de la misma pantalla que la barra.", + "label": "Mostrar pantalla enfocada" + }, "label-mode": { "description": "Elegir cómo se muestran las etiquetas de los espacios de trabajo.", "label": "Modo de etiqueta" diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index f7f84835..c7764732 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -352,6 +352,10 @@ "description": "Ne pas afficher les espaces de travail sans fenêtres.", "label": "Masquer les inoccupés" }, + "show-focused-screen": { + "description": "Afficher les espaces de travail de l'écran ciblé au lieu de l'écran où se trouve la barre.", + "label": "Afficher l'écran ciblé" + }, "label-mode": { "description": "Choisir comment les étiquettes d'espace de travail sont affichées.", "label": "Mode d'étiquette" diff --git a/Assets/Translations/nl.json b/Assets/Translations/nl.json index df6b15c1..6c5d0d4c 100644 --- a/Assets/Translations/nl.json +++ b/Assets/Translations/nl.json @@ -352,6 +352,10 @@ "description": "Werkruimten zonder vensters niet weergeven.", "label": "Ongebruikte verbergen" }, + "show-focused-screen": { + "description": "Werkruimten van het gefocuste scherm weergeven in plaats van hetzelfde scherm als de balk.", + "label": "Gefocust scherm weergeven" + }, "label-mode": { "description": "Kies hoe labels van werkruimten worden weergegeven.", "label": "Labelmodus" diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index f7e79563..28fb5d7d 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -352,6 +352,10 @@ "description": "Não exibir áreas de trabalho sem janelas.", "label": "Ocultar desocupados" }, + "show-focused-screen": { + "description": "Mostrar áreas de trabalho da tela em foco em vez da mesma tela que a barra.", + "label": "Mostrar tela em foco" + }, "label-mode": { "description": "Escolher como os rótulos de espaço de trabalho são exibidos.", "label": "Modo de rótulo" diff --git a/Assets/Translations/ru.json b/Assets/Translations/ru.json index cfdfc306..93af13bb 100644 --- a/Assets/Translations/ru.json +++ b/Assets/Translations/ru.json @@ -352,6 +352,10 @@ "description": "Не отображать рабочие пространства без окон.", "label": "Скрыть незанятые" }, + "show-focused-screen": { + "description": "Показывать рабочие пространства с фокусированного экрана вместо того же экрана, что и панель.", + "label": "Показать фокусированный экран" + }, "label-mode": { "description": "Выберите, как отображаются метки рабочих пространств.", "label": "Режим метки" diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index 65d25cb5..79b15a67 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -352,6 +352,10 @@ "description": "Penceresi olmayan çalışma alanlarını gösterme.", "label": "Dolu olmayanları gizle" }, + "show-focused-screen": { + "description": "Çubuğun bulunduğu ekran yerine odaklanmış ekrandaki çalışma alanlarını göster.", + "label": "Odaklanmış ekranı göster" + }, "label-mode": { "description": "Çalışma alanı etiketlerinin nasıl gösterileceğini seçin.", "label": "Etiket Modu" diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index 085fd5ed..5df28571 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -352,6 +352,10 @@ "description": "Не відображати робочі простори без вікон.", "label": "Приховати незайняті" }, + "show-focused-screen": { + "description": "Показувати робочі простори з фокусованого екрана замість того ж екрана, що й панель.", + "label": "Показати фокусований екран" + }, "label-mode": { "description": "Виберіть, як відображаються мітки робочих просторів.", "label": "Режим міток" diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index e6c3b8dd..8986486a 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -352,6 +352,10 @@ "description": "不显示没有窗口的工作区。", "label": "隐藏未占用" }, + "show-focused-screen": { + "description": "显示来自焦点屏幕的工作区,而不是与任务栏相同的屏幕。", + "label": "显示焦点屏幕" + }, "label-mode": { "description": "选择工作区标签的显示方式。", "label": "标签模式" From 5f2a6ffc9dfc51f4b5d50da197e69d2fae421d58 Mon Sep 17 00:00:00 2001 From: shouya <526598+shouya@users.noreply.github.com> Date: Fri, 21 Nov 2025 15:01:02 +0900 Subject: [PATCH 04/16] fix workspace.qml warning --- Modules/Bar/Widgets/Workspace.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index 680ca2df..1d7156f1 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -46,7 +46,7 @@ Item { readonly property string labelMode: (widgetSettings.labelMode !== undefined) ? widgetSettings.labelMode : widgetMetadata.labelMode readonly property bool hideUnoccupied: (widgetSettings.hideUnoccupied !== undefined) ? widgetSettings.hideUnoccupied : widgetMetadata.hideUnoccupied - readonly property bool showFocusedScreen: (widgetSettings.showFocusedScreen !== undefined) ? widgetSettings.showFocusedScreen : widgetMetadata.showFocusedScreen + readonly property bool showFocusedScreen: (widgetSettings.showFocusedScreen !== undefined) ? widgetSettings.showFocusedScreen : false readonly property int characterCount: isVertical ? 2 : ((widgetSettings.characterCount !== undefined) ? widgetSettings.characterCount : widgetMetadata.characterCount) property bool isDestroying: false From 724fed60013a0e0dfcbaa86556623b0f82218e51 Mon Sep 17 00:00:00 2001 From: Corey Woodworth Date: Fri, 21 Nov 2025 20:23:34 -0500 Subject: [PATCH 05/16] Initial commit --- Helpers/ColorList.js | 187 ++++++++++++++++++++++++++++++ Shaders/frag/color_picker.frag | 54 +++++++++ Shaders/qsb/color_picker.frag.qsb | Bin 0 -> 2482 bytes Widgets/NColorSlider.qml | 177 ++++++++++++++++++++++++++++ 4 files changed, 418 insertions(+) create mode 100644 Helpers/ColorList.js create mode 100644 Shaders/frag/color_picker.frag create mode 100644 Shaders/qsb/color_picker.frag.qsb create mode 100644 Widgets/NColorSlider.qml diff --git a/Helpers/ColorList.js b/Helpers/ColorList.js new file mode 100644 index 00000000..38932149 --- /dev/null +++ b/Helpers/ColorList.js @@ -0,0 +1,187 @@ +var colors = [ + // --- REDS --- + { name: "MistyRose", color: "mistyrose" }, + { name: "LightPink", color: "lightpink" }, + { name: "Pink", color: "pink" }, + { name: "PaleVioletRed", color: "palevioletred" }, + { name: "Pink 500", color: "#E91E63" }, // Material + { name: "HotPink", color: "hotpink" }, + { name: "DeepPink", color: "deeppink" }, + { name: "MediumVioletRed", color: "mediumvioletred" }, + { name: "LightSalmon", color: "lightsalmon" }, + { name: "Salmon", color: "salmon" }, + { name: "DarkSalmon", color: "darksalmon" }, + { name: "LightCoral", color: "lightcoral" }, + { name: "IndianRed", color: "indianred" }, + { name: "Alizarin", color: "#E74C3C" }, // Flat UI + { name: "Red 500", color: "#F44336" }, // Material + { name: "Crimson", color: "crimson" }, + { name: "Red", color: "red" }, + { name: "FireBrick", color: "firebrick" }, + { name: "DarkRed", color: "darkred" }, + { name: "Maroon", color: "maroon" }, + { name: "Brown", color: "brown" }, + + // --- ORANGES & BROWNS --- + { name: "Coral", color: "coral" }, + { name: "Tomato", color: "tomato" }, + { name: "OrangeRed", color: "orangered" }, + { name: "Deep Orange 500", color: "#FF5722" }, // Material + { name: "DarkOrange", color: "darkorange" }, + { name: "Carrot", color: "#E67E22" }, // Flat UI + { name: "Orange 500", color: "#FF9800" }, // Material + { name: "Orange", color: "orange" }, + { name: "SandyBrown", color: "sandybrown" }, + { name: "Peru", color: "peru" }, + { name: "Chocolate", color: "chocolate" }, + { name: "SaddleBrown", color: "saddlebrown" }, + { name: "Sienna", color: "sienna" }, + { name: "Brown 500", color: "#795548" }, // Material + + // --- YELLOWS, BEIGES & GOLDS --- + { name: "LightYellow", color: "lightyellow" }, + { name: "LemonChiffon", color: "lemonchiffon" }, + { name: "LightGoldenrodYellow", color: "lightgoldenrodyellow" }, + { name: "PapayaWhip", color: "papayawhip" }, + { name: "Moccasin", color: "moccasin" }, + { name: "PeachPuff", color: "peachpuff" }, + { name: "NavajoWhite", color: "navajowhite" }, + { name: "Wheat", color: "wheat" }, + { name: "BurlyWood", color: "burlywood" }, + { name: "Tan", color: "tan" }, + { name: "Bisque", color: "bisque" }, + { name: "BlanchedAlmond", color: "blanchedalmond" }, + { name: "Cornsilk", color: "cornsilk" }, + { name: "PaleGoldenrod", color: "palegoldenrod" }, + { name: "Khaki", color: "khaki" }, + { name: "DarkKhaki", color: "darkkhaki" }, + { name: "Goldenrod", color: "goldenrod" }, + { name: "DarkGoldenrod", color: "darkgoldenrod" }, + { name: "Sun Flower", color: "#F1C40F" }, // Flat UI + { name: "Yellow 500", color: "#FFEB3B" }, // Material + { name: "Yellow", color: "yellow" }, + { name: "Gold", color: "gold" }, + { name: "Amber 500", color: "#FFC107" }, // Material + + // --- GREENS --- + { name: "GreenYellow", color: "greenyellow" }, + { name: "Chartreuse", color: "chartreuse" }, + { name: "LawnGreen", color: "lawngreen" }, + { name: "Lime 500", color: "#CDDC39" }, // Material + { name: "Lime", color: "lime" }, + { name: "LimeGreen", color: "limegreen" }, + { name: "PaleGreen", color: "palegreen" }, + { name: "LightGreen", color: "lightgreen" }, + { name: "Light Green 500", color: "#8BC34A" }, // Material + { name: "MediumSpringGreen", color: "mediumspringgreen" }, + { name: "SpringGreen", color: "springgreen" }, + { name: "Emerald", color: "#2ECC71" }, // Flat UI + { name: "Green 500", color: "#4CAF50" }, // Material + { name: "MediumSeaGreen", color: "mediumseagreen" }, + { name: "SeaGreen", color: "seagreen" }, + { name: "ForestGreen", color: "forestgreen" }, + { name: "Green", color: "green" }, + { name: "DarkGreen", color: "darkgreen" }, + { name: "YellowGreen", color: "yellowgreen" }, + { name: "OliveDrab", color: "olivedrab" }, + { name: "Olive", color: "olive" }, + { name: "DarkOliveGreen", color: "darkolivegreen" }, + + // --- TEALS & CYANS --- + { name: "MediumAquamarine", color: "mediumaquamarine" }, + { name: "DarkSeaGreen", color: "darkseagreen" }, + { name: "LightSeaGreen", color: "lightseagreen" }, + { name: "DarkCyan", color: "darkcyan" }, + { name: "Teal", color: "teal" }, + { name: "Turquoise", color: "#1ABC9C" }, // Flat UI + { name: "LightCyan", color: "lightcyan" }, + { name: "PaleTurquoise", color: "paleturquoise" }, + { name: "Aquamarine", color: "aquamarine" }, + { name: "Turquoise", color: "turquoise" }, + { name: "MediumTurquoise", color: "mediumturquoise" }, + { name: "DarkTurquoise", color: "darkturquoise" }, + { name: "Aqua", color: "aqua" }, + { name: "Cyan", color: "cyan" }, + { name: "Cyan 500", color: "#00BCD4" }, // Material + { name: "CadetBlue", color: "cadetblue" }, + { name: "Teal 500", color: "#009688" }, // Material + { name: "DarkSlateGray", color: "darkslategray" }, + + // --- BLUES --- + { name: "PowderBlue", color: "powderblue" }, + { name: "LightBlue", color: "lightblue" }, + { name: "SkyBlue", color: "skyblue" }, + { name: "LightSkyBlue", color: "lightskyblue" }, + { name: "Light Blue 500", color: "#03A9F4" }, // Material + { name: "DeepSkyBlue", color: "deepskyblue" }, + { name: "DodgerBlue", color: "dodgerblue" }, + { name: "CornflowerBlue", color: "cornflowerblue" }, + { name: "Peter River", color: "#3498DB" }, // Flat UI + { name: "Blue 500", color: "#2196F3" }, // Material + { name: "SteelBlue", color: "steelblue" }, + { name: "LightSteelBlue", color: "lightsteelblue" }, + { name: "RoyalBlue", color: "royalblue" }, + { name: "Blue", color: "blue" }, + { name: "MediumBlue", color: "mediumblue" }, + { name: "Belize Hole", color: "#2980B9" }, // Flat UI + { name: "DarkBlue", color: "darkblue" }, + { name: "Navy", color: "navy" }, + { name: "MidnightBlue", color: "midnightblue" }, + { name: "Midnight Blue", color: "#2C3E50" }, // Flat UI (Same name, different color) + { name: "Indigo 500", color: "#3F51B5" }, // Material + { name: "DarkSlateBlue", color: "darkslateblue" }, + { name: "MediumSlateBlue", color: "mediumslateblue" }, + { name: "SlateBlue", color: "slateblue" }, + + // --- PURPLES & MAGENTAS --- + { name: "Lavender", color: "lavender" }, + { name: "Thistle", color: "thistle" }, + { name: "Plum", color: "plum" }, + { name: "Violet", color: "violet" }, + { name: "Orchid", color: "orchid" }, + { name: "Fuchsia", color: "fuchsia" }, + { name: "Magenta", color: "magenta" }, + { name: "MediumOrchid", color: "mediumorchid" }, + { name: "MediumPurple", color: "mediumpurple" }, + { name: "Amethyst", color: "#9B59B6" }, // Flat UI + { name: "Purple 500", color: "#9C27B0" }, // Material + { name: "BlueViolet", color: "blueviolet" }, + { name: "DarkViolet", color: "darkviolet" }, + { name: "DarkOrchid", color: "darkorchid" }, + { name: "DarkMagenta", color: "darkmagenta" }, + { name: "Purple", color: "purple" }, + { name: "Deep Purple 500", color: "#673AB7" }, // Material + { name: "Indigo", color: "indigo" }, + + // --- NEUTRALS --- + { name: "White", color: "white" }, + { name: "Snow", color: "snow" }, + { name: "HoneyDew", color: "honeydew" }, + { name: "MintCream", color: "mintcream" }, + { name: "Azure", color: "azure" }, + { name: "AliceBlue", color: "aliceblue" }, + { name: "GhostWhite", color: "ghostwhite" }, + { name: "WhiteSmoke", color: "whitesmoke" }, + { name: "Seashell", color: "seashell" }, + { name: "Beige", color: "beige" }, + { name: "OldLace", color: "oldlace" }, + { name: "FloralWhite", color: "floralwhite" }, + { name: "Ivory", color: "ivory" }, + { name: "AntiqueWhite", color: "antiquewhite" }, + { name: "Linen", color: "linen" }, + { name: "LavenderBlush", color: "lavenderblush" }, + { name: "Gainsboro", color: "gainsboro" }, + { name: "LightGray", color: "lightgray" }, + { name: "Silver", color: "silver" }, + { name: "DarkGray", color: "darkgray" }, + { name: "Gray", color: "gray" }, + { name: "Grey 500", color: "#9E9E9E" }, // Material + { name: "Concrete", color: "#95A5A6" }, // Flat UI + { name: "DimGray", color: "dimgray" }, + { name: "LightSlateGray", color: "lightslategray" }, + { name: "SlateGray", color: "slategray" }, + { name: "Asbestos", color: "#7F8C8D" }, // Flat UI + { name: "Blue Grey 500", color: "#607D8B" }, // Material + { name: "Wet Asphalt", color: "#34495E" }, // Flat UI + { name: "Black", color: "black" } + ] diff --git a/Shaders/frag/color_picker.frag b/Shaders/frag/color_picker.frag new file mode 100644 index 00000000..c38539cd --- /dev/null +++ b/Shaders/frag/color_picker.frag @@ -0,0 +1,54 @@ +#version 450 + +layout(location = 0) in vec2 qt_TexCoord0; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf +{ + mat4 qt_Matrix; + vec4 params; // x=opacity, y=fixedVal, z=mode, w=padding +}; + +vec3 hsv2rgb(vec3 c) +{ + vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); + return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); +} + +void main() +{ + float x = qt_TexCoord0.x; + float y = 1.0 - qt_TexCoord0.y; // Flip Y direction + + // Unpack vector + float opacity = params.x; + float fixedVal = params.y; + float mode = params.z + 0.1; // +0.1 safely handles float rounding + + // Build permutation matrices for swizzling + vec3 base = vec3(x, y, fixedVal); + + // Determine Mode Logic + // 0: (Red/Hue) 1: (Green/Sat) 2: (Blue/Val) + int perm = int(mode) % 3; + + float isHSV = step(3.0, mode); + + // Branchless Selection + vec3 mask = vec3( + float(perm == 0), + float(perm == 1), + float(perm == 2)); + + // Swizzle fo shizzle + // If perm 0: base.zxy -> (fixedVal, x, y) + // If perm 1: base.xzy -> (x, fixedVal, y) + // If perm 2: base.xyz -> (x, y, fixedVal) + vec3 rgb_base = (base.zxy * mask.x) + (base.xzy * mask.y) + (base.xyz * mask.z); + + // Final mix + vec3 finalColor = mix(rgb_base, hsv2rgb(rgb_base), isHSV); + + fragColor = vec4(finalColor, 1.0) * opacity; +} diff --git a/Shaders/qsb/color_picker.frag.qsb b/Shaders/qsb/color_picker.frag.qsb new file mode 100644 index 0000000000000000000000000000000000000000..f73dfd6618c3662d3abf45cc691b7c2fbea63487 GIT binary patch literal 2482 zcmV;j2~G9@040uiob6g`dlSbM9&BT$4!IC6A#Iv$a6=@p70Hri8)IT>NFauq00C0h z-K?dRyg}L(yDM9AN)tj#)25_p)AkSaQ|X`R4@mz&KlexUOE2flyd#g+;*yj;PoLJC zXYrhO&SmDzIq#1BLA;bW^JLo+iu8UaM;*xMhOU#Ra{tHD}WNEICUhz*nqQ}Dy zo)Hx?a70xa*QB{}|3K40u_Bse&Ldk)iad?Z8#;Z`y;|Qn3K5fQk5(zfBgS7qjMF5)f$>f$@9fAU9i2^V zNT`fxYzOq_r0;%-^&!p~`gss`T7Jop?-=XYLsorqzF+Q&$NOo-$+GBumh^{^yncxd zP^Q#+hNRtqEKnXl2K^_XKLGtFG0*rBk_Ux8-49>W@@{(nc=vEeen!f7k8634)SsIh zB~R>UFMRBV?jFPU^HTRubNfg>hID%QW3JgpjdVC3N!uz3ROWcd!TBGqgk_9%e;jgXzt z$J3Ct{&%6DGxXi-eh25Q^70k^dP6ah}m*Q|w zc)++<{y?7C*L%SE495)HYYE#Lum!`m4m@e=Cu|$Q0>kz?aBZve8DdR!=tiMmp@H1wZRXoOUA42Cz0_^d;iFk2q${ z{s_2^a|3=DzX|Neh=0R~{Q+WY-yg!aS=%>(Yu_Ki?xx}U7W{vNTt>ijoSz8ABU=6` zWY)b6c^bYx5$c+B+gQWTgyJcEem@7M-(ASvr^rNfc44ssBiGEVgEVipElP1g;1Q$`D5MRK>rJ@>khELQ=KH9`9ATK=;q^nkl8oS?KSqiA3k)gJqv8V=zeB#cR2w6TK_p<2cWkD zdC+z6P569Ho{2iEZ$WPu^SX|{jk)KIcrPU4y$Fooe&f9b9~S()XvBL7@dhx@dDsVB z*ZIp>k6Gu3fa|rql2}U$*egA9#q(+8UfUl|*dGCQIAO2%G72B8r|X>Sc+7Y;{;E(l zre9tES)uPg%3lV$df(&Nx5*uO;M#Wqn0~eI39;E*Da0xm=UIdf=kXs@6)aCl3o(G- z2UyUb6@~{#*4!}i0^iDIv%`(hEqPK}^{T54t5OS`cxDUi`2-F}ao8-y)=IN7{Qj^- zPu+9F+)v}IQ3z=4X zBW)eFillChk-WaX4!h8eo1t&jy;f?0)km#T&8at14XGyqcAd(SDTcJul-?KFEX zWi}{HwC}(xTYO|GyDb*pqasRw1ZdwPTNlg&^K$tPEs&gOE(Ty8o)RhTSJ6vrow^sYFOtIjQ-qP(<6 zJ0X!wsxPbIQjyH^FvZc**2`AjT!I&!zId4wqS$Su@_hPI%?ML>qH8*gv`HzSvlbsg zHVy~q1lZ0W;b+ZPD>f-q`7cSfLVGu?38Nbnt z%~tC6M)5D5x;nqOc;RGLh3?^Fu^A_v7-7l7#mn|3C#Ut2{iL z*$-wj`~GZZKP;P7x{?fLP|~BLv`QDJAr@E-vHlHSgTF`1Y`W@tavLVQ*iBa1z3EM+ zL>ARnazoQ3=&h3Ex2+wlKCD~Vf%5KDUEAZaF4QiLm^C#r-DIQ}hdNh4kI>3PAO)pl zBAKrJZ8DnCmfa3+nDjj$|4Ot;-)kcca#44)_axx)(+C zE7({g4B{YeH{9sp@bHM|mugMwieq&*c4~GMmuue2aRZOMdihoUC$oB-?s)9N@}0UH zQRZDsTJ`$tQ0FU=xHWRis#on-?ePpiD{iH&Dgc=RLZHXJMG9;lj(GlH-S^S6E2NODvyJ-Sv$#RHKwW8Okvofo`hhl wGH}l?OxFj-XrVw6GBff{S)jO4CvMgHukPx9Z`w-RTjn*E)RWJ@0FwNz>!?~4ApigX literal 0 HcmV?d00001 diff --git a/Widgets/NColorSlider.qml b/Widgets/NColorSlider.qml new file mode 100644 index 00000000..1e7264eb --- /dev/null +++ b/Widgets/NColorSlider.qml @@ -0,0 +1,177 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Effects +import qs.Commons +import qs.Services.UI + +Slider { + id: root + + property color fillColor: "transparent" + property var cutoutColor: Color.mSurface + property bool snapAlways: true + property real widthRatio: 0.7 + property string tooltipText + property string tooltipDirection: "auto" + property bool hovering: false + property color topColor: "white" + property color bottomColor: "black" + property bool rainbowMode: false + + readonly property real knobDiameter: Math.round((Style.baseWidgetSize * widthRatio * Style.uiScaleRatio) / 2) * 2 + readonly property real trackWidth: Math.round((knobDiameter * 0.4 * Style.uiScaleRatio) / 2) * 2 + readonly property real cutoutExtra: Math.round((Style.baseWidgetSize * 0.1 * Style.uiScaleRatio) / 2) * 2 + + //horizontal: false + orientation: Qt.Vertical + + padding: cutoutExtra / 2 + + snapMode: snapAlways ? Slider.SnapAlways : Slider.SnapOnRelease + implicitWidth: Math.max(trackWidth, knobDiameter) + + background: Rectangle { + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + + x: root.leftPadding + root.availableWidth / 2 - width / 2 + + height: root.availableHeight - root.knobDiameter + width: root.trackWidth + + radius: width / 2 + color: Qt.alpha(Color.mSurface, 0.5) + border.color: Qt.alpha(Color.mOutline, 0.5) + border.width: Style.borderS + + // Gradients + gradient: root.rainbowMode ? rainbowGradient : standardGradient + Gradient { + id: standardGradient + orientation: Gradient.Vertical + GradientStop { + position: 0.0 + color: root.topColor + } + GradientStop { + position: 1.0 + color: root.bottomColor + } + } + Gradient { + id: rainbowGradient + orientation: Gradient.Vertical + GradientStop { + position: 0.000 + color: "#FF0000" + } + GradientStop { + position: 0.167 + color: "#FF00FF" + } + GradientStop { + position: 0.333 + color: "#0000FF" + } + GradientStop { + position: 0.500 + color: "#00FFFF" + } + GradientStop { + position: 0.667 + color: "#00FF00" + } + GradientStop { + position: 0.833 + color: "#FFFF00" + } + GradientStop { + position: 1.000 + color: "#FF0000" + } + } + + // Circular cutout + Rectangle { + id: knobCutout + implicitWidth: root.knobDiameter + root.cutoutExtra + implicitHeight: root.knobDiameter + root.cutoutExtra + radius: width / 2 + color: root.cutoutColor !== undefined ? root.cutoutColor : Color.mSurface + + y: root.visualPosition * (root.availableHeight - root.knobDiameter) - ((root.knobDiameter + root.cutoutExtra) / 2) + anchors.horizontalCenter: parent.horizontalCenter + } + } + + handle: Item { + implicitWidth: root.knobDiameter + implicitHeight: root.knobDiameter + y: root.topPadding + root.visualPosition * (root.availableHeight - height) + anchors.horizontalCenter: parent.horizontalCenter + + Rectangle { + id: knob + implicitWidth: root.knobDiameter + implicitHeight: root.knobDiameter + radius: width / 2 + color: { + if (root.rainbowMode) { + // Hue Logic: Map position (0.0 to 1.0) directly to Hue + return Qt.hsva(1 - root.visualPosition, 1, 1, 1); + } else { + // Linear Interpolation for Standard Gradients + // visualPosition 0.0 = Top, 1.0 = Bottom + var t = root.visualPosition; + var r = root.topColor.r * (1 - t) + root.bottomColor.r * t; + var g = root.topColor.g * (1 - t) + root.bottomColor.g * t; + var b = root.topColor.b * (1 - t) + root.bottomColor.b * t; + return Qt.rgba(r, g, b, 1); + } + } + + border.color: root.pressed ? Color.mHover : Color.mPrimary + border.width: Style.borderL + anchors.centerIn: parent + + Behavior on color { + ColorAnimation { + duration: Style.animationFast + } + } + } + + MouseArea { + enabled: true + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + hoverEnabled: true + acceptedButtons: Qt.NoButton // Don't accept any mouse buttons - only hover + propagateComposedEvents: true + + onEntered: { + root.hovering = true; + if (root.tooltipText) { + TooltipService.show(screen, knob, root.tooltipText, root.tooltipDirection); + } + } + + onExited: { + root.hovering = false; + if (root.tooltipText) { + TooltipService.hide(); + } + } + } + + // Hide tooltip when slider is pressed (anywhere on the slider) + Connections { + target: root + function onPressedChanged() { + if (root.pressed && root.tooltipText) { + TooltipService.hide(); + } + } + } + } +} From bd1c9d30d9d1acca685a50111d17da2e27da748f Mon Sep 17 00:00:00 2001 From: Corey Woodworth Date: Fri, 21 Nov 2025 20:29:46 -0500 Subject: [PATCH 06/16] I forgor to add the ColorPicker file --- Widgets/NColorPickerDialog.qml | 791 ++++++++++++++++++++++++--------- 1 file changed, 577 insertions(+), 214 deletions(-) diff --git a/Widgets/NColorPickerDialog.qml b/Widgets/NColorPickerDialog.qml index cae30ea6..09e20ffe 100644 --- a/Widgets/NColorPickerDialog.qml +++ b/Widgets/NColorPickerDialog.qml @@ -1,16 +1,25 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts -import "../Helpers/ColorsConvert.js" as ColorsConvert import qs.Commons import qs.Widgets +import qs.Services.UI +import "../Helpers/ColorList.js" as ColorList Popup { id: root property color selectedColor: Color.black - property real currentHue: 0 - property real currentSaturation: 0 + property string editMode: "r" // Options: "r", "g", "b", "h", "s", "v" + + // Code to deal with Hue when color is achromatic + property real stableHue: 0 + onSelectedColorChanged: { + if (selectedColor.hsvHue >= 0) { + stableHue = selectedColor.hsvHue; + } + } + readonly property real displayHue: selectedColor.hsvHue < 0 ? stableHue : selectedColor.hsvHue signal colorSelected(color color) @@ -116,256 +125,610 @@ Popup { } } - // Hex input - RowLayout { - Layout.fillWidth: true - spacing: Style.marginM - - NLabel { - label: I18n.tr("widgets.color-picker.hex.label") - description: I18n.tr("widgets.color-picker.hex.description") - Layout.fillWidth: true - } - - NTextInput { - text: root.selectedColor.toString().toUpperCase() - fontFamily: Settings.data.ui.fontFixed - Layout.fillWidth: true - onEditingFinished: { - if (/^#[0-9A-F]{6}$/i.test(text)) { - root.selectedColor = text; - } - } - } - } - - // RGB sliders section + // Main Box NBox { Layout.fillWidth: true - Layout.preferredHeight: slidersSection.implicitHeight + Style.marginL * 2 + Layout.preferredHeight: controlsOutterColumn.implicitHeight + Style.marginL * 2 + + ButtonGroup { + id: colorValues + } ColumnLayout { - id: slidersSection + id: controlsOutterColumn anchors.fill: parent anchors.margins: Style.marginL spacing: Style.marginM - NLabel { - label: I18n.tr("widgets.color-picker.rgb.label") - description: I18n.tr("widgets.color-picker.rgb.description") - Layout.fillWidth: true - } - RowLayout { - Layout.fillWidth: true - spacing: Style.marginM + spacing: Style.marginL // Ensure nice gap between Left and Right groups - NText { - text: "R" - font.weight: Font.Bold - Layout.preferredWidth: 20 - } - - NValueSlider { - id: redSlider + // SpinBoxes Column + ColumnLayout { Layout.fillWidth: true - from: 0 - to: 255 - value: Math.round(root.selectedColor.r * 255) - onMoved: value => { - root.selectedColor = Qt.rgba(value / 255, root.selectedColor.g, root.selectedColor.b, 1); - var hsv = ColorsConvert.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, root.selectedColor.b * 255); - root.currentHue = hsv.h; - root.currentSaturation = hsv.s; - } - text: Math.round(value) - } - } + Layout.fillHeight: true + Layout.alignment: Qt.AlignTop + Layout.preferredWidth: 3 - RowLayout { - Layout.fillWidth: true - spacing: Style.marginM + // --- RED --- + RowLayout { + Layout.fillWidth: true + spacing: Style.marginM - NText { - text: "G" - font.weight: Font.Bold - Layout.preferredWidth: 20 - } + NRadioButton { + ButtonGroup.group: colorValues + text: "R" + font.weight: Font.Bold + checked: true + onClicked: root.editMode = "r" + Layout.fillWidth: false + } - NValueSlider { - id: greenSlider - Layout.fillWidth: true - from: 0 - to: 255 - value: Math.round(root.selectedColor.g * 255) - onMoved: value => { - root.selectedColor = Qt.rgba(root.selectedColor.r, value / 255, root.selectedColor.b, 1); - // Update stored hue and saturation when RGB changes - var hsv = ColorsConvert.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, root.selectedColor.b * 255); - root.currentHue = hsv.h; - root.currentSaturation = hsv.s; - } - text: Math.round(value) - } - } + NSpinBox { + id: redSpinBox + from: 0 + to: 255 - RowLayout { - Layout.fillWidth: true - spacing: Style.marginM - - NText { - text: "B" - font.weight: Font.Bold - Layout.preferredWidth: 20 - } - - NValueSlider { - id: blueSlider - Layout.fillWidth: true - from: 0 - to: 255 - value: Math.round(root.selectedColor.b * 255) - onMoved: value => { - root.selectedColor = Qt.rgba(root.selectedColor.r, root.selectedColor.g, value / 255, 1); - // Update stored hue and saturation when RGB changes - var hsv = ColorsConvert.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, root.selectedColor.b * 255); - root.currentHue = hsv.h; - root.currentSaturation = hsv.s; - } - text: Math.round(value) - } - } - - RowLayout { - Layout.fillWidth: true - spacing: Style.marginM - - NText { - text: I18n.tr("widgets.color-picker.brightness") - font.weight: Font.Bold - Layout.preferredWidth: 80 - } - - NValueSlider { - id: brightnessSlider - Layout.fillWidth: true - from: 0 - to: 100 - value: { - var hsv = ColorsConvert.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, root.selectedColor.b * 255); - return hsv.v; + onValueChanged: { + if (!selectedSlider.pressed && !fieldMouse.pressed && !hexInput.activeFocus && value !== Math.round(root.selectedColor.r * 255)) { + root.selectedColor = Qt.rgba(value / 255, root.selectedColor.g, root.selectedColor.b, 1); + } + } + Binding { + target: redSpinBox + property: "value" + value: Math.round(root.selectedColor.r * 255) + } + } } - onMoved: value => { - var hue = root.currentHue; - var saturation = root.currentSaturation; - if (hue === 0 && saturation === 0) { - var hsv = ColorsConvert.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, root.selectedColor.b * 255); - hue = hsv.h; - saturation = hsv.s; - root.currentHue = hue; - root.currentSaturation = saturation; - } + // --- GREEN --- + RowLayout { + Layout.fillWidth: true + spacing: Style.marginM - var rgb = ColorsConvert.hsvToRgb(hue, saturation, value); - root.selectedColor = Qt.rgba(rgb.r / 255, rgb.g / 255, rgb.b / 255, 1); - } - text: Math.round(brightnessSlider.value) + "%" - } - } - } - } + NRadioButton { + ButtonGroup.group: colorValues + text: "G" + font.weight: Font.Bold + onClicked: root.editMode = "g" + Layout.fillWidth: false + } - NBox { - Layout.fillWidth: true - Layout.preferredHeight: themePalette.implicitHeight + Style.marginL * 2 + NSpinBox { + id: greenSpinBox + from: 0 + to: 255 - ColumnLayout { - id: themePalette - anchors.fill: parent - anchors.margins: Style.marginL - spacing: Style.marginS + onValueChanged: { + if (!selectedSlider.pressed && !fieldMouse.pressed && !hexInput.activeFocus && value !== Math.round(root.selectedColor.g * 255)) { + root.selectedColor = Qt.rgba(root.selectedColor.r, value / 255, root.selectedColor.b, 1); + } + } + Binding { + target: greenSpinBox + property: "value" + value: Math.round(root.selectedColor.g * 255) + } + } + } - NLabel { - label: I18n.tr("widgets.color-picker.theme-colors.label") - description: I18n.tr("widgets.color-picker.theme-colors.description") - Layout.fillWidth: true - } + // --- BLUE --- + RowLayout { + Layout.fillWidth: true + spacing: Style.marginM - Flow { - spacing: 6 - Layout.fillWidth: true - flow: Flow.LeftToRight + NRadioButton { + ButtonGroup.group: colorValues + text: "B" + font.weight: Font.Bold + onClicked: root.editMode = "b" + Layout.fillWidth: false + } - Repeater { - model: [Color.mPrimary, Color.mSecondary, Color.mTertiary, Color.mError, Color.mSurface, Color.mSurfaceVariant, Color.mOutline, Color.white, Color.black] + NSpinBox { + id: blueSpinBox + from: 0 + to: 255 - Rectangle { - width: 24 - height: 24 - radius: 4 - color: modelData - border.color: root.selectedColor === modelData ? Color.mPrimary : Color.mOutline - border.width: root.selectedColor === modelData ? 2 : 1 + onValueChanged: { + if (!selectedSlider.pressed && !fieldMouse.pressed && !hexInput.activeFocus && value !== Math.round(root.selectedColor.b * 255)) { + root.selectedColor = Qt.rgba(root.selectedColor.r, root.selectedColor.g, value / 255, 1); + } + } + Binding { + target: blueSpinBox + property: "value" + value: Math.round(root.selectedColor.b * 255) + } + } + } - MouseArea { - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - onClicked: { - root.selectedColor = modelData; - var hsv = ColorsConvert.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, root.selectedColor.b * 255); - root.currentHue = hsv.h; - root.currentSaturation = hsv.s; + // Spacer + Item { + Layout.fillHeight: true + Layout.fillWidth: true + } + + // --- HUE --- + RowLayout { + Layout.fillWidth: true + spacing: Style.marginM + + NRadioButton { + ButtonGroup.group: colorValues + text: "H" + font.weight: Font.Bold + checked: true + onClicked: root.editMode = "h" + Layout.fillWidth: false + } + + NSpinBox { + id: hueSpinBox + from: 0 + to: 360 + + onValueChanged: { + if (!selectedSlider.pressed && !fieldMouse.pressed && !hexInput.activeFocus && value !== Math.round(root.displayHue * 360)) { + var newHue = value / 360; + root.selectedColor = Qt.hsva(newHue, root.selectedColor.hsvSaturation, root.selectedColor.hsvValue, 1); + root.stableHue = newHue; + } + } + + Binding { + target: hueSpinBox + property: "value" + value: Math.round(root.displayHue * 360) + } + } + } + + // --- SATURATION --- + RowLayout { + Layout.fillWidth: true + spacing: Style.marginM + + NRadioButton { + ButtonGroup.group: colorValues + text: "S" + font.weight: Font.Bold + onClicked: root.editMode = "s" + Layout.fillWidth: false + } + + NSpinBox { + id: satSpinBox + from: 0 + to: 100 + + onValueChanged: { + if (!selectedSlider.pressed && !fieldMouse.pressed && !hexInput.activeFocus && value !== Math.round(root.selectedColor.hsvSaturation * 100)) { + root.selectedColor = Qt.hsva(root.selectedColor.hsvHue, value / 100, root.selectedColor.hsvValue, 1); + } + } + Binding { + target: satSpinBox + property: "value" + value: Math.round(root.selectedColor.hsvSaturation * 100) + } + } + } + + // --- VALUE --- + RowLayout { + spacing: Style.marginM + + NRadioButton { + ButtonGroup.group: colorValues + text: "V" + font.weight: Font.Bold + onClicked: root.editMode = "v" + Layout.fillWidth: false + } + + NSpinBox { + id: valSpinBox + from: 0 + to: 100 + + onValueChanged: { + if (!selectedSlider.pressed && !fieldMouse.pressed && !hexInput.activeFocus && value !== Math.round(root.selectedColor.hsvValue * 100)) { + root.selectedColor = Qt.hsva(root.selectedColor.hsvHue, root.selectedColor.hsvSaturation, value / 100, 1); + } + } + Binding { + target: valSpinBox + property: "value" + value: Math.round(root.selectedColor.hsvValue * 100) + } + } + } + + // Spacer + Item { + Layout.fillHeight: true + Layout.fillWidth: true + } + + // Hex input + RowLayout { + id: hexInput + Layout.fillWidth: true + spacing: Style.marginM + + NLabel { + label: "Hex:" // I18n.tr("widgets.color-picker.hex.label") + // description: I18n.tr("widgets.color-picker.hex.description") + Layout.alignment: Qt.AlignVCenter + } + + NTextInput { + text: root.selectedColor.toString().toUpperCase() + fontFamily: Settings.data.ui.fontFixed + Layout.fillWidth: true + Layout.minimumWidth: implicitWidth + onEditingFinished: { + if (/^#[0-9A-F]{6}$/i.test(text)) { + root.selectedColor = text; + } } } } } - } - } - } - NBox { - Layout.fillWidth: true - Layout.preferredHeight: genericPalette.implicitHeight + Style.marginL * 2 + RowLayout { + Layout.fillWidth: true + Layout.fillHeight: true + Layout.preferredWidth: 5 + Layout.alignment: Qt.AlignTop + spacing: Style.marginS - ColumnLayout { - id: genericPalette - anchors.fill: parent - anchors.margins: Style.marginL - spacing: Style.marginS + Layout.topMargin: Math.round(2 * Style.uiScaleRatio) //Shim to try and line up colorField with SpinBoxes - NLabel { - label: I18n.tr("widgets.color-picker.palette.label") - description: I18n.tr("widgets.color-picker.palette.description") - Layout.fillWidth: true - } + // --- SLIDER --- + NColorSlider { + id: selectedSlider + Layout.fillHeight: true + rainbowMode: root.editMode === "h" + topColor: { + if (rainbowMode) + return "transparent"; + switch (root.editMode) { + case "r": + return "#FF0000"; + case "g": + return "#00FF00"; + case "b": + return "#0000FF"; + default: + return "#FFFFFF"; + } + } - Flow { - Layout.fillWidth: true - Layout.fillHeight: true - spacing: 6 - flow: Flow.LeftToRight + Binding { + target: selectedSlider + property: "value" + when: !selectedSlider.pressed // Only update from model when NOT dragging + value: { + switch (root.editMode) { + case "r": + return root.selectedColor.r; + case "g": + return root.selectedColor.g; + case "b": + return root.selectedColor.b; + case "h": + return root.displayHue; + case "s": + return root.selectedColor.hsvSaturation; + case "v": + return root.selectedColor.hsvValue; + default: + return 0; + } + } + } - Repeater { - model: ["#F44336", "#E91E63", "#9C27B0", "#673AB7", "#3F51B5", "#2196F3", "#03A9F4", "#00BCD4", "#009688", "#4CAF50", "#8BC34A", "#CDDC39", "#FFEB3B", "#FFC107", "#FF9800", "#FF5722", "#795548", "#9E9E9E", "#E74C3C", "#E67E22", "#F1C40F", "#2ECC71", "#1ABC9C", "#3498DB", "#2980B9", "#9B59B6", "#34495E", "#2C3E50", "#95A5A6", "#7F8C8D", - Color.white, Color.black] + onMoved: { + var v = value; + switch (root.editMode) { + case "r": + root.selectedColor = Qt.rgba(v, root.selectedColor.g, root.selectedColor.b, 1); + break; + case "g": + root.selectedColor = Qt.rgba(root.selectedColor.r, v, root.selectedColor.b, 1); + break; + case "b": + root.selectedColor = Qt.rgba(root.selectedColor.r, root.selectedColor.g, v, 1); + break; + case "h": + root.selectedColor = Qt.hsva(v, root.selectedColor.hsvSaturation, root.selectedColor.hsvValue, 1); + root.stableHue = v; + break; + case "s": + root.selectedColor = Qt.hsva(root.selectedColor.hsvHue, v, root.selectedColor.hsvValue, 1); + break; + case "v": + root.selectedColor = Qt.hsva(root.selectedColor.hsvHue, root.selectedColor.hsvSaturation, v, 1); + break; + } + } + } + // Color Field Rectangle { - width: 24 - height: 24 - radius: Style.radiusXXS - color: modelData - border.color: root.selectedColor === modelData ? Color.mPrimary : Color.mOutline - border.width: Math.max(1, root.selectedColor === modelData ? Style.borderM : Style.borderS) + id: colorField + Layout.fillWidth: true + + Layout.preferredHeight: width + Layout.alignment: Qt.AlignTop + + radius: 0 + border.color: Color.mOutline + border.width: Style.borderS + clip: true + + ShaderEffect { + anchors.fill: parent + anchors.margins: 1 // Avoid drawing over the border + + fragmentShader: "../Shaders/qsb/color_picker.frag.qsb" + + // Map strings to integers + readonly property int modeInt: { + switch (root.editMode) { + case "r": + return 0; + case "g": + return 1; + case "b": + return 2; + case "h": + return 3; + case "s": + return 4; + case "v": + return 5; + default: + return 0; + } + } + + // Pass which radio is selected + readonly property real fixedVal: { + switch (root.editMode) { + case "r": + return root.selectedColor.r; + case "g": + return root.selectedColor.g; + case "b": + return root.selectedColor.b; + case "h": + return root.displayHue; + case "s": + return root.selectedColor.hsvSaturation; + case "v": + return root.selectedColor.hsvValue; + default: + return 0; + } + } + + // Send as one vector because GPUs are so damn picky + property vector4d params: Qt.vector4d(1.0, fixedVal, modeInt, 0) + } MouseArea { + id: fieldMouse anchors.fill: parent - cursorShape: Qt.PointingHandCursor - onClicked: { - root.selectedColor = modelData; - var hsv = ColorsConvert.rgbToHsv(root.selectedColor.r * 255, root.selectedColor.g * 255, root.selectedColor.b * 255); - root.currentHue = hsv.h; - root.currentSaturation = hsv.s; + cursorShape: Qt.CrossCursor + + // Update color when clicking or dragging + function updateColor(mouse) { + // Normalize X and Y (0.0 to 1.0) + var xVal = Math.max(0, Math.min(1, mouse.x / width)); + var yVal = Math.max(0, Math.min(1, 1.0 - (mouse.y / height))); // Flip Y (0 at bottom) + + // Get the current fixed value (from the slider) + var fixed = 0.0; + + switch (root.editMode) { + case "r": + fixed = root.selectedColor.r; + root.selectedColor = Qt.rgba(fixed, xVal, yVal, 1); + break; + case "g": + fixed = root.selectedColor.g; + root.selectedColor = Qt.rgba(xVal, fixed, yVal, 1); + break; + case "b": + fixed = root.selectedColor.b; + root.selectedColor = Qt.rgba(xVal, yVal, fixed, 1); + break; + case "h": + // Use stableHue to prevent flipping to -1 + fixed = root.displayHue; + root.selectedColor = Qt.hsva(fixed, xVal, yVal, 1); + root.stableHue = fixed; + break; + case "s": + fixed = root.selectedColor.hsvSaturation; + root.selectedColor = Qt.hsva(xVal, fixed, yVal, 1); + // If we dragged Hue (xVal), update stableHue + root.stableHue = yVal; + break; + case "v": + fixed = root.selectedColor.hsvValue; + root.selectedColor = Qt.hsva(xVal, yVal, fixed, 1); + // If we dragged Hue (xVal), update stableHue + root.stableHue = xVal; + break; + } + } + onPressed: mouse => updateColor(mouse) + onPositionChanged: mouse => updateColor(mouse) + } + + // Color Indicator + Rectangle { + width: 10 + height: 10 + radius: 5 + color: "transparent" + border.color: root.selectedColor.hsvValue < 0.5 ? "white" : "black" + border.width: 1 + + // Find position based on the current color + readonly property point selectedPos: { + switch (root.editMode) { + case "r": + return Qt.point(root.selectedColor.g, root.selectedColor.b); + case "g": + return Qt.point(root.selectedColor.r, root.selectedColor.b); + case "b": + return Qt.point(root.selectedColor.r, root.selectedColor.g); + case "h": + return Qt.point(root.selectedColor.hsvSaturation, root.selectedColor.hsvValue); + case "s": + return Qt.point(root.displayHue, root.selectedColor.hsvValue); + case "v": + return Qt.point(root.displayHue, root.selectedColor.hsvSaturation); + default: + return Qt.point(0, 0); + } + } + + // Convert values to pixel position + x: (selectedPos.x * parent.width) - width / 2 + y: ((1.0 - selectedPos.y) * parent.height) - height / 2 + } + + // Redraw the border in case Color Indicator is near the edge + Rectangle { + anchors.fill: parent + color: "transparent" + border.color: Color.mOutline + border.width: Style.borderS + antialiasing: false + } + } + } + } + + NCollapsible { + id: paletteCollapsible + label: I18n.tr("widgets.color-picker.palette.label") + description: I18n.tr("widgets.color-picker.palette.description") + + Layout.fillWidth: true + contentSpacing: Style.marginS + + GridLayout { + Layout.alignment: Qt.AlignHCenter + columns: 15 + columnSpacing: 6 + rowSpacing: 6 + + Repeater { + model: ColorList.colors + + Rectangle { + width: 24 + height: 24 + radius: Style.radiusXXS + color: modelData.color + border.color: root.selectedColor.toString() === modelData.color.toString() ? Color.mPrimary : Color.mOutline + border.width: Math.max(1, root.selectedColor.toString() === modelData.color.toString() ? Style.borderM : Style.borderS) + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + hoverEnabled: true + + onEntered: { + TooltipService.show(screen, parent, modelData.name + "\n" + parent.color.toString().toUpperCase(), "auto"); + } + onExited: { + TooltipService.hide(); + } + onClicked: { + root.selectedColor = modelData.color; + TooltipService.hide(); + } + } + } + } + + NDivider { + Layout.columnSpan: 15 + Layout.fillWidth: true + Layout.topMargin: Style.marginXS + Layout.bottomMargin: 0 + } + + NLabel { + Layout.columnSpan: 15 + Layout.fillWidth: true + description: I18n.tr("widgets.color-picker.theme-colors.description") + } + + Repeater { + model: [ + { + name: "mPrimary", + color: Color.mPrimary + }, + { + name: "mSecondary", + color: Color.mSecondary + }, + { + name: "mTertiary", + color: Color.mTertiary + }, + { + name: "mError", + color: Color.mError + }, + { + name: "mSurface", + color: Color.mSurface + }, + { + name: "mSurfaceVariant", + color: Color.mSurfaceVariant + }, + { + name: "mOutline", + color: Color.mOutline + } + ] + + Rectangle { + width: 24 + height: 24 + radius: 4 + color: modelData.color + border.color: root.selectedColor.toString() === modelData.color.toString() ? Color.mPrimary : Color.mOutline + border.width: root.selectedColor.toString() === modelData.color.toString() ? 2 : 1 + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + hoverEnabled: true + + onEntered: { + TooltipService.show(screen, parent, modelData.name + "\n" + parent.color.toString().toUpperCase(), "auto"); + } + onExited: { + TooltipService.hide(); + } + onClicked: { + root.selectedColor = modelData.color; + TooltipService.hide(); + } } } } From 42f782abbf289ce53cde872bab456862daee3037 Mon Sep 17 00:00:00 2001 From: Corey Woodworth Date: Fri, 21 Nov 2025 22:39:05 -0500 Subject: [PATCH 07/16] Update tooltip code, Use an Enum for editMode, setup strings for i18n --- Widgets/NColorPickerDialog.qml | 119 +++++++++++++++------------------ 1 file changed, 54 insertions(+), 65 deletions(-) diff --git a/Widgets/NColorPickerDialog.qml b/Widgets/NColorPickerDialog.qml index 09e20ffe..7d1ad5c7 100644 --- a/Widgets/NColorPickerDialog.qml +++ b/Widgets/NColorPickerDialog.qml @@ -1,6 +1,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts +import QtQml import qs.Commons import qs.Widgets import qs.Services.UI @@ -10,7 +11,16 @@ Popup { id: root property color selectedColor: Color.black - property string editMode: "r" // Options: "r", "g", "b", "h", "s", "v" + + enum EditMode { + R, + G, + B, + H, + S, + V + } + property int editMode: NColorPickerDialog.EditMode.R // Code to deal with Hue when color is achromatic property real stableHue: 0 @@ -160,7 +170,7 @@ Popup { text: "R" font.weight: Font.Bold checked: true - onClicked: root.editMode = "r" + onClicked: root.editMode = NColorPickerDialog.EditMode.R Layout.fillWidth: false } @@ -191,7 +201,7 @@ Popup { ButtonGroup.group: colorValues text: "G" font.weight: Font.Bold - onClicked: root.editMode = "g" + onClicked: root.editMode = NColorPickerDialog.EditMode.G Layout.fillWidth: false } @@ -222,7 +232,7 @@ Popup { ButtonGroup.group: colorValues text: "B" font.weight: Font.Bold - onClicked: root.editMode = "b" + onClicked: root.editMode = NColorPickerDialog.EditMode.B Layout.fillWidth: false } @@ -260,7 +270,7 @@ Popup { text: "H" font.weight: Font.Bold checked: true - onClicked: root.editMode = "h" + onClicked: root.editMode = NColorPickerDialog.EditMode.H Layout.fillWidth: false } @@ -294,7 +304,7 @@ Popup { ButtonGroup.group: colorValues text: "S" font.weight: Font.Bold - onClicked: root.editMode = "s" + onClicked: root.editMode = NColorPickerDialog.EditMode.S Layout.fillWidth: false } @@ -324,7 +334,7 @@ Popup { ButtonGroup.group: colorValues text: "V" font.weight: Font.Bold - onClicked: root.editMode = "v" + onClicked: root.editMode = NColorPickerDialog.EditMode.V Layout.fillWidth: false } @@ -359,8 +369,7 @@ Popup { spacing: Style.marginM NLabel { - label: "Hex:" // I18n.tr("widgets.color-picker.hex.label") - // description: I18n.tr("widgets.color-picker.hex.description") + label: I18n.tr("widgets.color-picker.hex") Layout.alignment: Qt.AlignVCenter } @@ -396,11 +405,11 @@ Popup { if (rainbowMode) return "transparent"; switch (root.editMode) { - case "r": + case NColorPickerDialog.EditMode.R: return "#FF0000"; - case "g": + case NColorPickerDialog.EditMode.G: return "#00FF00"; - case "b": + case NColorPickerDialog.EditMode.B: return "#0000FF"; default: return "#FFFFFF"; @@ -413,17 +422,17 @@ Popup { when: !selectedSlider.pressed // Only update from model when NOT dragging value: { switch (root.editMode) { - case "r": + case NColorPickerDialog.EditMode.R: return root.selectedColor.r; - case "g": + case NColorPickerDialog.EditMode.G: return root.selectedColor.g; - case "b": + case NColorPickerDialog.EditMode.B: return root.selectedColor.b; - case "h": + case NColorPickerDialog.EditMode.H: return root.displayHue; - case "s": + case NColorPickerDialog.EditMode.S: return root.selectedColor.hsvSaturation; - case "v": + case NColorPickerDialog.EditMode.V: return root.selectedColor.hsvValue; default: return 0; @@ -434,23 +443,23 @@ Popup { onMoved: { var v = value; switch (root.editMode) { - case "r": + case NColorPickerDialog.EditMode.R: root.selectedColor = Qt.rgba(v, root.selectedColor.g, root.selectedColor.b, 1); break; - case "g": + case NColorPickerDialog.EditMode.G: root.selectedColor = Qt.rgba(root.selectedColor.r, v, root.selectedColor.b, 1); break; - case "b": + case NColorPickerDialog.EditMode.B: root.selectedColor = Qt.rgba(root.selectedColor.r, root.selectedColor.g, v, 1); break; - case "h": + case NColorPickerDialog.EditMode.H: root.selectedColor = Qt.hsva(v, root.selectedColor.hsvSaturation, root.selectedColor.hsvValue, 1); root.stableHue = v; break; - case "s": + case NColorPickerDialog.EditMode.S: root.selectedColor = Qt.hsva(root.selectedColor.hsvHue, v, root.selectedColor.hsvValue, 1); break; - case "v": + case NColorPickerDialog.EditMode.V: root.selectedColor = Qt.hsva(root.selectedColor.hsvHue, root.selectedColor.hsvSaturation, v, 1); break; } @@ -476,40 +485,20 @@ Popup { fragmentShader: "../Shaders/qsb/color_picker.frag.qsb" - // Map strings to integers - readonly property int modeInt: { - switch (root.editMode) { - case "r": - return 0; - case "g": - return 1; - case "b": - return 2; - case "h": - return 3; - case "s": - return 4; - case "v": - return 5; - default: - return 0; - } - } - // Pass which radio is selected readonly property real fixedVal: { switch (root.editMode) { - case "r": + case NColorPickerDialog.EditMode.R: return root.selectedColor.r; - case "g": + case NColorPickerDialog.EditMode.G: return root.selectedColor.g; - case "b": + case NColorPickerDialog.EditMode.B: return root.selectedColor.b; - case "h": + case NColorPickerDialog.EditMode.H: return root.displayHue; - case "s": + case NColorPickerDialog.EditMode.S: return root.selectedColor.hsvSaturation; - case "v": + case NColorPickerDialog.EditMode.V: return root.selectedColor.hsvValue; default: return 0; @@ -517,7 +506,7 @@ Popup { } // Send as one vector because GPUs are so damn picky - property vector4d params: Qt.vector4d(1.0, fixedVal, modeInt, 0) + property vector4d params: Qt.vector4d(1.0, fixedVal, root.editMode, 0) } MouseArea { @@ -535,31 +524,31 @@ Popup { var fixed = 0.0; switch (root.editMode) { - case "r": + case NColorPickerDialog.EditMode.R: fixed = root.selectedColor.r; root.selectedColor = Qt.rgba(fixed, xVal, yVal, 1); break; - case "g": + case NColorPickerDialog.EditMode.G: fixed = root.selectedColor.g; root.selectedColor = Qt.rgba(xVal, fixed, yVal, 1); break; - case "b": + case NColorPickerDialog.EditMode.B: fixed = root.selectedColor.b; root.selectedColor = Qt.rgba(xVal, yVal, fixed, 1); break; - case "h": + case NColorPickerDialog.EditMode.H: // Use stableHue to prevent flipping to -1 fixed = root.displayHue; root.selectedColor = Qt.hsva(fixed, xVal, yVal, 1); root.stableHue = fixed; break; - case "s": + case NColorPickerDialog.EditMode.S: fixed = root.selectedColor.hsvSaturation; root.selectedColor = Qt.hsva(xVal, fixed, yVal, 1); // If we dragged Hue (xVal), update stableHue root.stableHue = yVal; break; - case "v": + case NColorPickerDialog.EditMode.V: fixed = root.selectedColor.hsvValue; root.selectedColor = Qt.hsva(xVal, yVal, fixed, 1); // If we dragged Hue (xVal), update stableHue @@ -583,17 +572,17 @@ Popup { // Find position based on the current color readonly property point selectedPos: { switch (root.editMode) { - case "r": + case NColorPickerDialog.EditMode.R: return Qt.point(root.selectedColor.g, root.selectedColor.b); - case "g": + case NColorPickerDialog.EditMode.G: return Qt.point(root.selectedColor.r, root.selectedColor.b); - case "b": + case NColorPickerDialog.EditMode.B: return Qt.point(root.selectedColor.r, root.selectedColor.g); - case "h": + case NColorPickerDialog.EditMode.H: return Qt.point(root.selectedColor.hsvSaturation, root.selectedColor.hsvValue); - case "s": + case NColorPickerDialog.EditMode.S: return Qt.point(root.displayHue, root.selectedColor.hsvValue); - case "v": + case NColorPickerDialog.EditMode.V: return Qt.point(root.displayHue, root.selectedColor.hsvSaturation); default: return Qt.point(0, 0); @@ -648,7 +637,7 @@ Popup { hoverEnabled: true onEntered: { - TooltipService.show(screen, parent, modelData.name + "\n" + parent.color.toString().toUpperCase(), "auto"); + TooltipService.show(parent, modelData.name + "\n" + parent.color.toString().toUpperCase(), "auto"); } onExited: { TooltipService.hide(); @@ -671,7 +660,7 @@ Popup { NLabel { Layout.columnSpan: 15 Layout.fillWidth: true - description: I18n.tr("widgets.color-picker.theme-colors.description") + description: I18n.tr("widgets.color-picker.palette.theme-colors") } Repeater { From 89d7a63248df5f5b96ab6b06696418b703e3cfc3 Mon Sep 17 00:00:00 2001 From: Corey Woodworth Date: Fri, 21 Nov 2025 22:43:03 -0500 Subject: [PATCH 08/16] removed unneeded 'auto' since it's by default --- Widgets/NColorPickerDialog.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Widgets/NColorPickerDialog.qml b/Widgets/NColorPickerDialog.qml index 7d1ad5c7..d90b6253 100644 --- a/Widgets/NColorPickerDialog.qml +++ b/Widgets/NColorPickerDialog.qml @@ -637,7 +637,7 @@ Popup { hoverEnabled: true onEntered: { - TooltipService.show(parent, modelData.name + "\n" + parent.color.toString().toUpperCase(), "auto"); + TooltipService.show(parent, modelData.name + "\n" + parent.color.toString().toUpperCase()); } onExited: { TooltipService.hide(); From 0ba80b10a9a5eb121c6455a02bb6baaf3b16dd34 Mon Sep 17 00:00:00 2001 From: Corey Woodworth Date: Fri, 21 Nov 2025 22:59:40 -0500 Subject: [PATCH 09/16] removed 'Hex:' from i18n because of numerous translation issues --- Widgets/NColorPickerDialog.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Widgets/NColorPickerDialog.qml b/Widgets/NColorPickerDialog.qml index d90b6253..b3b777b5 100644 --- a/Widgets/NColorPickerDialog.qml +++ b/Widgets/NColorPickerDialog.qml @@ -369,7 +369,7 @@ Popup { spacing: Style.marginM NLabel { - label: I18n.tr("widgets.color-picker.hex") + label: "Hex:" Layout.alignment: Qt.AlignVCenter } From 2c1c1da64cd54a61a8aa166a222b192ccdb1a8cd Mon Sep 17 00:00:00 2001 From: Corey Woodworth Date: Fri, 21 Nov 2025 23:00:29 -0500 Subject: [PATCH 10/16] Translations done --- Assets/Translations/de.json | 16 ++-------------- Assets/Translations/en.json | 16 ++-------------- Assets/Translations/es.json | 16 ++-------------- Assets/Translations/fr.json | 16 ++-------------- Assets/Translations/nl.json | 16 ++-------------- Assets/Translations/pt.json | 16 ++-------------- Assets/Translations/ru.json | 16 ++-------------- Assets/Translations/tr.json | 16 ++-------------- Assets/Translations/uk-UA.json | 16 ++-------------- Assets/Translations/zh-CN.json | 16 ++-------------- 10 files changed, 20 insertions(+), 140 deletions(-) diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index 28a127cc..c106e70b 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -2241,23 +2241,11 @@ "widgets": { "color-picker": { "apply": "Anwenden", - "brightness": "Helligkeit", "cancel": "Abbrechen", - "hex": { - "description": "Geben Sie einen hexadezimalen Farbcode ein.", - "label": "Hex-Farbe" - }, "palette": { "description": "Wählen Sie aus einer großen Auswahl vordefinierter Farben.", - "label": "Palette" - }, - "rgb": { - "description": "Passen Sie Rot-, Grün-, Blau- und Helligkeitswerte an.", - "label": "RGB-Werte" - }, - "theme-colors": { - "description": "Schnellzugriff auf die Farbpalette Ihres Themes.", - "label": "Theme-Farben" + "label": "Palette", + "theme-colors": "Schneller Zugriff auf die Farbpalette Ihres Themes." }, "title": "Farbauswahl" }, diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 424f2974..3fc0fb6b 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -2241,23 +2241,11 @@ "widgets": { "color-picker": { "apply": "Apply", - "brightness": "Brightness", "cancel": "Cancel", - "hex": { - "description": "Enter a hexadecimal color code.", - "label": "Hex color" - }, "palette": { "description": "Choose from a wide range of predefined colors.", - "label": "Palette" - }, - "rgb": { - "description": "Adjust red, green, blue, and brightness values.", - "label": "RGB values" - }, - "theme-colors": { - "description": "Quick access to your theme's color palette.", - "label": "Theme colors" + "label": "Palette", + "theme-colors": "Quick access to your theme's color palette." }, "title": "Color picker" }, diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index b677803a..ea441e9f 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -2241,23 +2241,11 @@ "widgets": { "color-picker": { "apply": "Aplicar", - "brightness": "Brillo", "cancel": "Cancelar", - "hex": { - "description": "Ingresa un código de color hexadecimal.", - "label": "Color hexadecimal" - }, "palette": { "description": "Elige entre una amplia gama de colores predefinidos.", - "label": "Paleta" - }, - "rgb": { - "description": "Ajusta los valores de rojo, verde, azul y brillo.", - "label": "Valores RGB" - }, - "theme-colors": { - "description": "Acceso rápido a la paleta de colores de tu tema.", - "label": "Colores del tema" + "label": "Paleta", + "theme-colors": "Acceso rápido a la paleta de colores de tu tema." }, "title": "Selector de colores" }, diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index 372e5a2a..7959a3a3 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -2241,23 +2241,11 @@ "widgets": { "color-picker": { "apply": "Appliquer", - "brightness": "Luminosité", "cancel": "Annuler", - "hex": { - "description": "Entrez un code couleur hexadécimal.", - "label": "Couleur hexadécimale" - }, "palette": { "description": "Choisissez parmi une large gamme de couleurs prédéfinies.", - "label": "Palette" - }, - "rgb": { - "description": "Ajustez les valeurs de rouge, vert, bleu et de luminosité.", - "label": "Valeurs RVB" - }, - "theme-colors": { - "description": "Accès rapide à la palette de couleurs de votre thème.", - "label": "Couleurs du thème" + "label": "Palette", + "theme-colors": "Accès rapide à la palette de couleurs de votre thème." }, "title": "Sélecteur de couleurs" }, diff --git a/Assets/Translations/nl.json b/Assets/Translations/nl.json index cee09441..9f886059 100644 --- a/Assets/Translations/nl.json +++ b/Assets/Translations/nl.json @@ -2241,23 +2241,11 @@ "widgets": { "color-picker": { "apply": "Toepassen", - "brightness": "Helderheid", "cancel": "Annuleren", - "hex": { - "description": "Voer een hexadecimale kleurcode in.", - "label": "Hex-kleur" - }, "palette": { "description": "Kies uit een breed scala aan vooraf gedefinieerde kleuren.", - "label": "Palet" - }, - "rgb": { - "description": "Pas de waarden voor rood, groen, blauw en helderheid aan.", - "label": "RGB-waarden" - }, - "theme-colors": { - "description": "Snelle toegang tot het kleurenpalet van je thema.", - "label": "Themakleuren" + "label": "Palet", + "theme-colors": "Snelle toegang tot het kleurenpalet van je thema." }, "title": "Kleurkiezer" }, diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index 27622da3..55a45b50 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -2241,23 +2241,11 @@ "widgets": { "color-picker": { "apply": "Aplicar", - "brightness": "Brilho", "cancel": "Cancelar", - "hex": { - "description": "Digite um código de cor hexadecimal.", - "label": "Cor hexadecimal" - }, "palette": { "description": "Escolha entre uma vasta gama de cores predefinidas.", - "label": "Paleta" - }, - "rgb": { - "description": "Ajuste os valores de vermelho, verde, azul e brilho.", - "label": "Valores RGB" - }, - "theme-colors": { - "description": "Acesso rápido à paleta de cores do seu tema.", - "label": "Cores do tema" + "label": "Paleta", + "theme-colors": "Acesso rápido à paleta de cores do seu tema." }, "title": "Seletor de cores" }, diff --git a/Assets/Translations/ru.json b/Assets/Translations/ru.json index 58862aa7..0dedcfe3 100644 --- a/Assets/Translations/ru.json +++ b/Assets/Translations/ru.json @@ -2241,23 +2241,11 @@ "widgets": { "color-picker": { "apply": "Применить", - "brightness": "Яркость", "cancel": "Отмена", - "hex": { - "description": "Введите шестнадцатеричный код цвета.", - "label": "Hex-цвет" - }, "palette": { "description": "Выберите из широкого диапазона предопределенных цветов.", - "label": "Палитра" - }, - "rgb": { - "description": "Настройте значения красного, зеленого, синего и яркости.", - "label": "Значения RGB" - }, - "theme-colors": { - "description": "Быстрый доступ к цветовой палитре вашей темы.", - "label": "Цвета темы" + "label": "Палитра", + "theme-colors": "Быстрый доступ к цветовой палитре вашей темы." }, "title": "Выбор цвета" }, diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index 7b902047..2d2aaee3 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -2241,23 +2241,11 @@ "widgets": { "color-picker": { "apply": "Uygula", - "brightness": "Parlaklık", "cancel": "İptal", - "hex": { - "description": "Onaltılık renk kodu girin.", - "label": "Hex renk" - }, "palette": { "description": "Önceden tanımlı renkler geniş yelpazesinden seçin.", - "label": "Palet" - }, - "rgb": { - "description": "Kırmızı, yeşil, mavi ve parlaklık değerlerini ayarlayın.", - "label": "RGB değerleri" - }, - "theme-colors": { - "description": "Temanızın renk paletine hızlı erişim.", - "label": "Tema renkleri" + "label": "Palet", + "theme-colors": "Temanızın renk paletine hızlı erişim." }, "title": "Renk seçici" }, diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index c20ff7a8..0e9a2c07 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -2241,23 +2241,11 @@ "widgets": { "color-picker": { "apply": "Застосувати", - "brightness": "Яскравість", "cancel": "Скасувати", - "hex": { - "description": "Введіть шістнадцятковий код кольору.", - "label": "Hex-колір" - }, "palette": { "description": "Виберіть із широкого діапазону попередньо визначених кольорів.", - "label": "Палітра" - }, - "rgb": { - "description": "Налаштуйте значення червоного, зеленого, синього та яскравості.", - "label": "Значення RGB" - }, - "theme-colors": { - "description": "Швидкий доступ до колірної палітри вашої теми.", - "label": "Кольори теми" + "label": "Палітра", + "theme-colors": "Швидкий доступ до колірної палітри вашої теми." }, "title": "Вибір кольору" }, diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index 98c641ef..7d375a7d 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -2241,23 +2241,11 @@ "widgets": { "color-picker": { "apply": "应用", - "brightness": "亮度", "cancel": "取消", - "hex": { - "description": "输入十六进制颜色代码。", - "label": "十六进制颜色" - }, "palette": { "description": "从各种预定义颜色中选择。", - "label": "调色板" - }, - "rgb": { - "description": "调整红、绿、蓝和亮度值。", - "label": "RGB 值" - }, - "theme-colors": { - "description": "快速访问您的主题调色板。", - "label": "主题颜色" + "label": "调色板", + "theme-colors": "快速访问您主题的调色板。" }, "title": "颜色选择器" }, From 7a64758ac87495adf186260c893a362394922a23 Mon Sep 17 00:00:00 2001 From: shouya <526598+shouya@users.noreply.github.com> Date: Sat, 22 Nov 2025 19:58:11 +0900 Subject: [PATCH 11/16] declare default value for the settings --- Modules/Bar/Widgets/Workspace.qml | 2 +- Services/UI/BarWidgetRegistry.qml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index 1d7156f1..680ca2df 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -46,7 +46,7 @@ Item { readonly property string labelMode: (widgetSettings.labelMode !== undefined) ? widgetSettings.labelMode : widgetMetadata.labelMode readonly property bool hideUnoccupied: (widgetSettings.hideUnoccupied !== undefined) ? widgetSettings.hideUnoccupied : widgetMetadata.hideUnoccupied - readonly property bool showFocusedScreen: (widgetSettings.showFocusedScreen !== undefined) ? widgetSettings.showFocusedScreen : false + readonly property bool showFocusedScreen: (widgetSettings.showFocusedScreen !== undefined) ? widgetSettings.showFocusedScreen : widgetMetadata.showFocusedScreen readonly property int characterCount: isVertical ? 2 : ((widgetSettings.characterCount !== undefined) ? widgetSettings.characterCount : widgetMetadata.characterCount) property bool isDestroying: false diff --git a/Services/UI/BarWidgetRegistry.qml b/Services/UI/BarWidgetRegistry.qml index 7357fe2a..76db458d 100644 --- a/Services/UI/BarWidgetRegistry.qml +++ b/Services/UI/BarWidgetRegistry.qml @@ -207,6 +207,7 @@ Singleton { "Workspace": { "allowUserSettings": true, "labelMode": "index", + "showFocusedScreen": false, "hideUnoccupied": false, "characterCount": 2 }, From 5604d79961b29dfd23677d2783a9e9d157597568 Mon Sep 17 00:00:00 2001 From: shouya <526598+shouya@users.noreply.github.com> Date: Sat, 22 Nov 2025 20:46:03 +0900 Subject: [PATCH 12/16] update translations --- Assets/Translations/de.json | 4 ++-- Assets/Translations/en.json | 4 ++-- Assets/Translations/es.json | 4 ++-- Assets/Translations/fr.json | 4 ++-- Assets/Translations/nl.json | 4 ++-- Assets/Translations/pt.json | 4 ++-- Assets/Translations/ru.json | 4 ++-- Assets/Translations/tr.json | 4 ++-- Assets/Translations/uk-UA.json | 4 ++-- Assets/Translations/zh-CN.json | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index 0f41b4ec..a934e887 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -353,8 +353,8 @@ "label": "Unbesetzte ausblenden" }, "show-focused-screen": { - "description": "Arbeitsbereiche vom fokussierten Bildschirm anzeigen, anstatt vom gleichen Bildschirm wie die Leiste.", - "label": "Fokussierten Bildschirm anzeigen" + "description": "Zeigt Arbeitsbereiche vom aktuell fokussierten Bildschirm an, statt vom Bildschirm, auf dem sich die Leiste befindet.", + "label": "Fokussiertem Bildschirm folgen" }, "label-mode": { "description": "Wählen Sie, wie Arbeitsbereichs-Beschriftungen angezeigt werden.", diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 3d1f5926..0ccaf804 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -353,8 +353,8 @@ "label": "Hide unoccupied" }, "show-focused-screen": { - "description": "Show workspaces from the focused screen instead of from the same screen as the bar.", - "label": "Show focused screen" + "description": "Display workspaces from the currently focused screen, rather than the screen where the bar is located.", + "label": "Follow Focused Screen" }, "label-mode": { "description": "Choose how workspace labels are displayed.", diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index e8a0818e..860b5247 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -353,8 +353,8 @@ "label": "Ocultar desocupados" }, "show-focused-screen": { - "description": "Mostrar espacios de trabajo de la pantalla enfocada en lugar de la misma pantalla que la barra.", - "label": "Mostrar pantalla enfocada" + "description": "Mostrar espacios de trabajo de la pantalla actualmente enfocada, en lugar de la pantalla donde se encuentra la barra.", + "label": "Seguir Pantalla Enfocada" }, "label-mode": { "description": "Elegir cómo se muestran las etiquetas de los espacios de trabajo.", diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index c7764732..1f833ef9 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -353,8 +353,8 @@ "label": "Masquer les inoccupés" }, "show-focused-screen": { - "description": "Afficher les espaces de travail de l'écran ciblé au lieu de l'écran où se trouve la barre.", - "label": "Afficher l'écran ciblé" + "description": "Afficher les espaces de travail de l'écran actuellement ciblé, plutôt que de l'écran où se trouve la barre.", + "label": "Suivre l'Écran Ciblé" }, "label-mode": { "description": "Choisir comment les étiquettes d'espace de travail sont affichées.", diff --git a/Assets/Translations/nl.json b/Assets/Translations/nl.json index 6c5d0d4c..46fabbfc 100644 --- a/Assets/Translations/nl.json +++ b/Assets/Translations/nl.json @@ -353,8 +353,8 @@ "label": "Ongebruikte verbergen" }, "show-focused-screen": { - "description": "Werkruimten van het gefocuste scherm weergeven in plaats van hetzelfde scherm als de balk.", - "label": "Gefocust scherm weergeven" + "description": "Werkruimten weergeven van het momenteel gefocuste scherm, in plaats van het scherm waar de balk zich bevindt.", + "label": "Gefocust Scherm Volgen" }, "label-mode": { "description": "Kies hoe labels van werkruimten worden weergegeven.", diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index 28fb5d7d..cdbdd6f6 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -353,8 +353,8 @@ "label": "Ocultar desocupados" }, "show-focused-screen": { - "description": "Mostrar áreas de trabalho da tela em foco em vez da mesma tela que a barra.", - "label": "Mostrar tela em foco" + "description": "Exibir áreas de trabalho da tela atualmente em foco, em vez da tela onde a barra está localizada.", + "label": "Seguir Tela em Foco" }, "label-mode": { "description": "Escolher como os rótulos de espaço de trabalho são exibidos.", diff --git a/Assets/Translations/ru.json b/Assets/Translations/ru.json index 93af13bb..f9c03b72 100644 --- a/Assets/Translations/ru.json +++ b/Assets/Translations/ru.json @@ -353,8 +353,8 @@ "label": "Скрыть незанятые" }, "show-focused-screen": { - "description": "Показывать рабочие пространства с фокусированного экрана вместо того же экрана, что и панель.", - "label": "Показать фокусированный экран" + "description": "Отображать рабочие пространства с текущего активного экрана, а не с экрана, на котором расположена панель.", + "label": "Следовать за Активным Экраном" }, "label-mode": { "description": "Выберите, как отображаются метки рабочих пространств.", diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index 79b15a67..7398d681 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -353,8 +353,8 @@ "label": "Dolu olmayanları gizle" }, "show-focused-screen": { - "description": "Çubuğun bulunduğu ekran yerine odaklanmış ekrandaki çalışma alanlarını göster.", - "label": "Odaklanmış ekranı göster" + "description": "Çubuğun bulunduğu ekran yerine, şu anda odaklanmış ekrandaki çalışma alanlarını göster.", + "label": "Odaklanmış Ekranı Takip Et" }, "label-mode": { "description": "Çalışma alanı etiketlerinin nasıl gösterileceğini seçin.", diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index 5df28571..3e0e6bb9 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -353,8 +353,8 @@ "label": "Приховати незайняті" }, "show-focused-screen": { - "description": "Показувати робочі простори з фокусованого екрана замість того ж екрана, що й панель.", - "label": "Показати фокусований екран" + "description": "Відображати робочі простори з поточного активного екрана, а не з екрана, на якому розташована панель.", + "label": "Слідувати за Активним Екраном" }, "label-mode": { "description": "Виберіть, як відображаються мітки робочих просторів.", diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index 8986486a..5e06d32c 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -353,8 +353,8 @@ "label": "隐藏未占用" }, "show-focused-screen": { - "description": "显示来自焦点屏幕的工作区,而不是与任务栏相同的屏幕。", - "label": "显示焦点屏幕" + "description": "显示当前焦点屏幕的工作区,而不是任务栏所在屏幕的工作区。", + "label": "跟随焦点屏幕" }, "label-mode": { "description": "选择工作区标签的显示方式。", From 1b706f84693e1ff37e3bf3dff222dd3eec5db117 Mon Sep 17 00:00:00 2001 From: shouya <526598+shouya@users.noreply.github.com> Date: Sat, 22 Nov 2025 20:49:37 +0900 Subject: [PATCH 13/16] update sources for consistent naming --- Assets/Translations/de.json | 2 +- Assets/Translations/en.json | 2 +- Assets/Translations/es.json | 2 +- Assets/Translations/fr.json | 2 +- Assets/Translations/nl.json | 2 +- Assets/Translations/pt.json | 2 +- Assets/Translations/ru.json | 2 +- Assets/Translations/tr.json | 2 +- Assets/Translations/uk-UA.json | 2 +- Assets/Translations/zh-CN.json | 2 +- Modules/Bar/Widgets/Workspace.qml | 8 ++++---- .../Bar/WidgetSettings/WorkspaceSettings.qml | 12 ++++++------ Services/UI/BarWidgetRegistry.qml | 2 +- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index a934e887..a342f7f6 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -352,7 +352,7 @@ "description": "Arbeitsbereiche ohne Fenster nicht anzeigen.", "label": "Unbesetzte ausblenden" }, - "show-focused-screen": { + "follow-focused-screen": { "description": "Zeigt Arbeitsbereiche vom aktuell fokussierten Bildschirm an, statt vom Bildschirm, auf dem sich die Leiste befindet.", "label": "Fokussiertem Bildschirm folgen" }, diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 0ccaf804..4513afc2 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -352,7 +352,7 @@ "description": "Don't display workspaces without windows.", "label": "Hide unoccupied" }, - "show-focused-screen": { + "follow-focused-screen": { "description": "Display workspaces from the currently focused screen, rather than the screen where the bar is located.", "label": "Follow Focused Screen" }, diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index 860b5247..8ecdcaba 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -352,7 +352,7 @@ "description": "No mostrar espacios de trabajo sin ventanas.", "label": "Ocultar desocupados" }, - "show-focused-screen": { + "follow-focused-screen": { "description": "Mostrar espacios de trabajo de la pantalla actualmente enfocada, en lugar de la pantalla donde se encuentra la barra.", "label": "Seguir Pantalla Enfocada" }, diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index 1f833ef9..fdde93bd 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -352,7 +352,7 @@ "description": "Ne pas afficher les espaces de travail sans fenêtres.", "label": "Masquer les inoccupés" }, - "show-focused-screen": { + "follow-focused-screen": { "description": "Afficher les espaces de travail de l'écran actuellement ciblé, plutôt que de l'écran où se trouve la barre.", "label": "Suivre l'Écran Ciblé" }, diff --git a/Assets/Translations/nl.json b/Assets/Translations/nl.json index 46fabbfc..e3c70b77 100644 --- a/Assets/Translations/nl.json +++ b/Assets/Translations/nl.json @@ -352,7 +352,7 @@ "description": "Werkruimten zonder vensters niet weergeven.", "label": "Ongebruikte verbergen" }, - "show-focused-screen": { + "follow-focused-screen": { "description": "Werkruimten weergeven van het momenteel gefocuste scherm, in plaats van het scherm waar de balk zich bevindt.", "label": "Gefocust Scherm Volgen" }, diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index cdbdd6f6..213fc1b1 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -352,7 +352,7 @@ "description": "Não exibir áreas de trabalho sem janelas.", "label": "Ocultar desocupados" }, - "show-focused-screen": { + "follow-focused-screen": { "description": "Exibir áreas de trabalho da tela atualmente em foco, em vez da tela onde a barra está localizada.", "label": "Seguir Tela em Foco" }, diff --git a/Assets/Translations/ru.json b/Assets/Translations/ru.json index f9c03b72..1d57d572 100644 --- a/Assets/Translations/ru.json +++ b/Assets/Translations/ru.json @@ -352,7 +352,7 @@ "description": "Не отображать рабочие пространства без окон.", "label": "Скрыть незанятые" }, - "show-focused-screen": { + "follow-focused-screen": { "description": "Отображать рабочие пространства с текущего активного экрана, а не с экрана, на котором расположена панель.", "label": "Следовать за Активным Экраном" }, diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index 7398d681..d80838da 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -352,7 +352,7 @@ "description": "Penceresi olmayan çalışma alanlarını gösterme.", "label": "Dolu olmayanları gizle" }, - "show-focused-screen": { + "follow-focused-screen": { "description": "Çubuğun bulunduğu ekran yerine, şu anda odaklanmış ekrandaki çalışma alanlarını göster.", "label": "Odaklanmış Ekranı Takip Et" }, diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index 3e0e6bb9..152c97e4 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -352,7 +352,7 @@ "description": "Не відображати робочі простори без вікон.", "label": "Приховати незайняті" }, - "show-focused-screen": { + "follow-focused-screen": { "description": "Відображати робочі простори з поточного активного екрана, а не з екрана, на якому розташована панель.", "label": "Слідувати за Активним Екраном" }, diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index 5e06d32c..999dcf57 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -352,7 +352,7 @@ "description": "不显示没有窗口的工作区。", "label": "隐藏未占用" }, - "show-focused-screen": { + "follow-focused-screen": { "description": "显示当前焦点屏幕的工作区,而不是任务栏所在屏幕的工作区。", "label": "跟随焦点屏幕" }, diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index 680ca2df..462d4255 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -46,7 +46,7 @@ Item { readonly property string labelMode: (widgetSettings.labelMode !== undefined) ? widgetSettings.labelMode : widgetMetadata.labelMode readonly property bool hideUnoccupied: (widgetSettings.hideUnoccupied !== undefined) ? widgetSettings.hideUnoccupied : widgetMetadata.hideUnoccupied - readonly property bool showFocusedScreen: (widgetSettings.showFocusedScreen !== undefined) ? widgetSettings.showFocusedScreen : widgetMetadata.showFocusedScreen + readonly property bool followFocusedScreen: (widgetSettings.followFocusedScreen !== undefined) ? widgetSettings.followFocusedScreen : widgetMetadata.followFocusedScreen readonly property int characterCount: isVertical ? 2 : ((widgetSettings.characterCount !== undefined) ? widgetSettings.characterCount : widgetMetadata.characterCount) property bool isDestroying: false @@ -165,7 +165,7 @@ Item { localWorkspaces.clear(); var focusedOutput = null; - if (showFocusedScreen) { + if (followFocusedScreen) { for (var i = 0; i < CompositorService.workspaces.count; i++) { const ws = CompositorService.workspaces.get(i); if (ws.isFocused) focusedOutput = ws.output.toLowerCase(); @@ -175,8 +175,8 @@ Item { if (screen !== null) { for (var i = 0; i < CompositorService.workspaces.count; i++) { const ws = CompositorService.workspaces.get(i); - if ((showFocusedScreen && ws.output.toLowerCase() == focusedOutput) || - (!showFocusedScreen && ws.output.toLowerCase() == screen.name.toLowerCase())) { + if ((followFocusedScreen && ws.output.toLowerCase() == focusedOutput) || + (!followFocusedScreen && ws.output.toLowerCase() == screen.name.toLowerCase())) { if (hideUnoccupied && !ws.isOccupied && !ws.isFocused) { continue; } diff --git a/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml b/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml index dfb4ef84..e807a131 100644 --- a/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml +++ b/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml @@ -14,7 +14,7 @@ ColumnLayout { property string valueLabelMode: widgetData.labelMode !== undefined ? widgetData.labelMode : widgetMetadata.labelMode property bool valueHideUnoccupied: widgetData.hideUnoccupied !== undefined ? widgetData.hideUnoccupied : widgetMetadata.hideUnoccupied - property bool valueShowFocusedScreen: widgetData.showFocusedScreen !== undefined ? widgetData.showFocusedScreen : widgetMetadata.showFocusedScreen + property bool valueFollowFocusedScreen: widgetData.followFocusedScreen !== undefined ? widgetData.followFocusedScreen : widgetMetadata.followFocusedScreen property int valueCharacterCount: widgetData.characterCount !== undefined ? widgetData.characterCount : widgetMetadata.characterCount function saveSettings() { @@ -22,7 +22,7 @@ ColumnLayout { settings.labelMode = valueLabelMode; settings.hideUnoccupied = valueHideUnoccupied; settings.characterCount = valueCharacterCount; - settings.showFocusedScreen = valueShowFocusedScreen; + settings.followFocusedScreen = valueFollowFocusedScreen; return settings; } @@ -54,10 +54,10 @@ ColumnLayout { } NToggle { - label: I18n.tr("bar.widget-settings.workspace.show-focused-screen.label") - description: I18n.tr("bar.widget-settings.workspace.show-focused-screen.description") - checked: valueShowFocusedScreen - onToggled: checked => valueShowFocusedScreen = checked + label: I18n.tr("bar.widget-settings.workspace.follow-focused-screen.label") + description: I18n.tr("bar.widget-settings.workspace.follow-focused-screen.description") + checked: valueFollowFocusedScreen + onToggled: checked => valueFollowFocusedScreen = checked } NToggle { diff --git a/Services/UI/BarWidgetRegistry.qml b/Services/UI/BarWidgetRegistry.qml index 76db458d..fe4e8bd6 100644 --- a/Services/UI/BarWidgetRegistry.qml +++ b/Services/UI/BarWidgetRegistry.qml @@ -207,7 +207,7 @@ Singleton { "Workspace": { "allowUserSettings": true, "labelMode": "index", - "showFocusedScreen": false, + "followFocusedScreen": false, "hideUnoccupied": false, "characterCount": 2 }, From a8ec22984ae2811ac9978bc0d66c353b5371c92f Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Sat, 22 Nov 2025 11:23:45 -0500 Subject: [PATCH 14/16] i18n --- Assets/Translations/de.json | 6 +++--- Assets/Translations/en.json | 6 +++--- Assets/Translations/es.json | 6 +++--- Assets/Translations/fr.json | 6 +++--- Assets/Translations/nl.json | 6 +++--- Assets/Translations/pt.json | 6 +++--- Assets/Translations/ru.json | 6 +++--- Assets/Translations/tr.json | 6 +++--- Assets/Translations/uk-UA.json | 6 +++--- Assets/Translations/zh-CN.json | 6 +++--- 10 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index f6844881..0626fd44 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -388,9 +388,9 @@ "discharging": "Wird entladen.", "discharging-rate": "Entladerate: {rate} W.", "health": "Zustand: {percent}%", + "idle": "Leerlauf.", "inhibit-idle-description": "Hält das System wach.", "inhibit-idle-label": "Wach halten", - "idle": "Leerlauf.", "no-battery-detected": "Keine Batterie erkannt.", "panel-title": "Akku", "plugged-in": "Angeschlossen.", @@ -678,9 +678,9 @@ "clipboard-loading-description": "Bitte warten", "clipboard-search-description": "Zwischenablageverlauf durchsuchen", "emoji": "Emoji-Auswahl", - "emoji-search-description": "Emojis suchen und kopieren", "emoji-loading": "Lade Emojis...", - "emoji-loading-description": "Bitte warten" + "emoji-loading-description": "Bitte warten", + "emoji-search-description": "Emojis suchen und kopieren" }, "quickSettings": { "bluetooth": { diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 3558cace..cb43dd09 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -388,9 +388,9 @@ "discharging": "Discharging", "discharging-rate": "Discharging rate: {rate} W", "health": "Health: {percent}%", + "idle": "Idle", "inhibit-idle-description": "Keeps the system awake.", "inhibit-idle-label": "Keep awake", - "idle": "Idle", "no-battery-detected": "No battery detected", "panel-title": "Battery", "plugged-in": "Plugged in", @@ -678,9 +678,9 @@ "clipboard-loading-description": "Please wait", "clipboard-search-description": "Search clipboard history", "emoji": "Emoji picker", - "emoji-search-description": "Search and copy emojis", "emoji-loading": "Loading emojis...", - "emoji-loading-description": "Please wait" + "emoji-loading-description": "Please wait", + "emoji-search-description": "Search and copy emojis" }, "quickSettings": { "bluetooth": { diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index 570b7ed4..f4777dd8 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -388,9 +388,9 @@ "discharging": "Descargando.", "discharging-rate": "Tasa de descarga: {rate} W.", "health": "Salud: {percent}%", + "idle": "Inactivo.", "inhibit-idle-description": "Mantiene el sistema despierto.", "inhibit-idle-label": "Mantener despierto", - "idle": "Inactivo.", "no-battery-detected": "No se detectó ninguna batería.", "panel-title": "Batería", "plugged-in": "Conectado.", @@ -678,9 +678,9 @@ "clipboard-loading-description": "Por favor espera", "clipboard-search-description": "Buscar en el historial del portapapeles", "emoji": "Selector de emojis", - "emoji-search-description": "Buscar y copiar emojis", "emoji-loading": "Cargando emojis...", - "emoji-loading-description": "Por favor espera" + "emoji-loading-description": "Por favor espera", + "emoji-search-description": "Buscar y copiar emojis" }, "quickSettings": { "bluetooth": { diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index d3ad5a33..83cb8ac4 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -388,9 +388,9 @@ "discharging": "En décharge.", "discharging-rate": "Taux de décharge : {rate} W.", "health": "État : {percent}%", + "idle": "Inactif.", "inhibit-idle-description": "Maintient le système éveillé.", "inhibit-idle-label": "Garder éveillé", - "idle": "Inactif.", "no-battery-detected": "Aucune batterie détectée.", "panel-title": "Batterie", "plugged-in": "Branché.", @@ -678,9 +678,9 @@ "clipboard-loading-description": "Veuillez patienter", "clipboard-search-description": "Rechercher dans l'historique du presse-papiers", "emoji": "Sélecteur d'émojis", - "emoji-search-description": "Rechercher et copier des émojis", "emoji-loading": "Chargement des émojis...", - "emoji-loading-description": "Veuillez patienter" + "emoji-loading-description": "Veuillez patienter", + "emoji-search-description": "Rechercher et copier des émojis" }, "quickSettings": { "bluetooth": { diff --git a/Assets/Translations/nl.json b/Assets/Translations/nl.json index cdeb3c11..4db6f93a 100644 --- a/Assets/Translations/nl.json +++ b/Assets/Translations/nl.json @@ -388,9 +388,9 @@ "discharging": "Ontladen.", "discharging-rate": "Ontlaadsnelheid: {rate} W.", "health": "Gezondheid: {percent}%", + "idle": "In rust.", "inhibit-idle-description": "Houdt het systeem wakker.", "inhibit-idle-label": "Wakker houden", - "idle": "In rust.", "no-battery-detected": "Geen batterij gedetecteerd.", "panel-title": "Batterij", "plugged-in": "Op netstroom.", @@ -678,9 +678,9 @@ "clipboard-loading-description": "Even geduld", "clipboard-search-description": "Zoek in klembordgeschiedenis", "emoji": "Emoji-kiezer", - "emoji-search-description": "Zoek en kopieer emoji's", "emoji-loading": "Emoji's laden...", - "emoji-loading-description": "Even geduld" + "emoji-loading-description": "Even geduld", + "emoji-search-description": "Zoek en kopieer emoji's" }, "quickSettings": { "bluetooth": { diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index de34cf7b..5b5bd66a 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -388,9 +388,9 @@ "discharging": "Descarregando.", "discharging-rate": "Taxa de descarregamento: {rate} W.", "health": "Saúde: {percent}%", + "idle": "Ocioso.", "inhibit-idle-description": "Mantém o sistema acordado.", "inhibit-idle-label": "Manter acordado", - "idle": "Ocioso.", "no-battery-detected": "Nenhuma bateria detectada.", "panel-title": "Bateria", "plugged-in": "Conectado.", @@ -678,9 +678,9 @@ "clipboard-loading-description": "Por favor, aguarde", "clipboard-search-description": "Pesquisar no histórico da área de transferência", "emoji": "Seletor de emojis", - "emoji-search-description": "Buscar e copiar emojis", "emoji-loading": "Carregando emojis...", - "emoji-loading-description": "Por favor, aguarde" + "emoji-loading-description": "Por favor, aguarde", + "emoji-search-description": "Buscar e copiar emojis" }, "quickSettings": { "bluetooth": { diff --git a/Assets/Translations/ru.json b/Assets/Translations/ru.json index 5bb42daf..f04800cd 100644 --- a/Assets/Translations/ru.json +++ b/Assets/Translations/ru.json @@ -388,9 +388,9 @@ "discharging": "Разрядка.", "discharging-rate": "Скорость разрядки: {rate} Вт.", "health": "Здоровье: {percent}%", + "idle": "Простой.", "inhibit-idle-description": "Не дает системе уснуть.", "inhibit-idle-label": "Не давать засыпать", - "idle": "Простой.", "no-battery-detected": "Батарея не обнаружена.", "panel-title": "Батарея", "plugged-in": "Подключено.", @@ -678,9 +678,9 @@ "clipboard-loading-description": "Пожалуйста, подождите", "clipboard-search-description": "Поиск в истории буфера обмена", "emoji": "Выбор эмодзи", - "emoji-search-description": "Поиск и копирование эмодзи", "emoji-loading": "Загрузка эмодзи...", - "emoji-loading-description": "Пожалуйста, подождите" + "emoji-loading-description": "Пожалуйста, подождите", + "emoji-search-description": "Поиск и копирование эмодзи" }, "quickSettings": { "bluetooth": { diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index b12ba1a2..41e6df14 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -388,9 +388,9 @@ "discharging": "Deşarj oluyor.", "discharging-rate": "Deşarj oranı: {rate} W.", "health": "Sağlık: {percent}%", + "idle": "Boşta.", "inhibit-idle-description": "Sistemi uyanık tutar.", "inhibit-idle-label": "Uyanık tut", - "idle": "Boşta.", "no-battery-detected": "Pil tespit edilmedi.", "panel-title": "Pil", "plugged-in": "Prize takılı.", @@ -678,9 +678,9 @@ "clipboard-loading-description": "Lütfen bekleyin", "clipboard-search-description": "Panoya geçmişini ara", "emoji": "Emoji seçici", - "emoji-search-description": "Emoji arama ve kopyalama", "emoji-loading": "Emojiler yükleniyor...", - "emoji-loading-description": "Lütfen bekleyin" + "emoji-loading-description": "Lütfen bekleyin", + "emoji-search-description": "Emoji arama ve kopyalama" }, "quickSettings": { "bluetooth": { diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index d2232ed8..01e98909 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -388,9 +388,9 @@ "discharging": "Розрядка.", "discharging-rate": "Швидкість розрядки: {rate} Вт.", "health": "Здоров'я: {percent}%", + "idle": "Бездіяльність.", "inhibit-idle-description": "Підтримує систему активною.", "inhibit-idle-label": "Не давати заснути", - "idle": "Бездіяльність.", "no-battery-detected": "Батарею не виявлено.", "panel-title": "Батарея", "plugged-in": "Підключено.", @@ -678,9 +678,9 @@ "clipboard-loading-description": "Зачекайте, будь ласка", "clipboard-search-description": "Пошук в історії буфера обміну", "emoji": "Обрати емодзі", - "emoji-search-description": "Пошук і копіювання емодзі", "emoji-loading": "Завантаження емодзі...", - "emoji-loading-description": "Зачекайте, будь ласка" + "emoji-loading-description": "Зачекайте, будь ласка", + "emoji-search-description": "Пошук і копіювання емодзі" }, "quickSettings": { "bluetooth": { diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index bf28a95a..81ee5e4f 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -388,9 +388,9 @@ "discharging": "正在放电。", "discharging-rate": "放电速率:{rate} W。", "health": "健康状况:{percent}%", + "idle": "空闲。", "inhibit-idle-description": "保持系统唤醒。", "inhibit-idle-label": "保持唤醒", - "idle": "空闲。", "no-battery-detected": "未检测到电池。", "panel-title": "电池", "plugged-in": "已接通电源。", @@ -678,9 +678,9 @@ "clipboard-loading-description": "请稍候", "clipboard-search-description": "搜索剪贴板历史记录", "emoji": "表情符号选择器", - "emoji-search-description": "搜索和复制表情符号", "emoji-loading": "正在加载表情符号...", - "emoji-loading-description": "请稍候" + "emoji-loading-description": "请稍候", + "emoji-search-description": "搜索和复制表情符号" }, "quickSettings": { "bluetooth": { From 69c60a6a5a5e1c44fd8090cda814742bd6d3861e Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Sat, 22 Nov 2025 11:24:21 -0500 Subject: [PATCH 15/16] BatteryPanel: show the powerprofile name in realtime + autofmt --- Modules/Panels/Battery/BatteryPanel.qml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Modules/Panels/Battery/BatteryPanel.qml b/Modules/Panels/Battery/BatteryPanel.qml index aea7ea4d..69a5b30d 100644 --- a/Modules/Panels/Battery/BatteryPanel.qml +++ b/Modules/Panels/Battery/BatteryPanel.qml @@ -28,13 +28,13 @@ SmartPanel { return I18n.tr("battery.no-battery-detected"); if (charging && battery.timeToFull > 0) { return I18n.tr("battery.time-until-full", { - "time": Time.formatVagueHumanReadableDuration(battery.timeToFull) - }); + "time": Time.formatVagueHumanReadableDuration(battery.timeToFull) + }); } if (!charging && battery.timeToEmpty > 0) { return I18n.tr("battery.time-left", { - "time": Time.formatVagueHumanReadableDuration(battery.timeToEmpty) - }); + "time": Time.formatVagueHumanReadableDuration(battery.timeToEmpty) + }); } return I18n.tr("battery.idle"); } @@ -154,7 +154,9 @@ SmartPanel { visible: healthAvailable NText { - text: I18n.tr("battery.health", {"percent": healthPercent}) + text: I18n.tr("battery.health", { + "percent": healthPercent + }) color: Color.mOnSurface pointSize: Style.fontSizeS font.weight: Style.fontWeightMedium @@ -179,7 +181,9 @@ SmartPanel { Layout.fillWidth: true spacing: Style.marginS NIcon { - icon: PowerProfileService.getIcon(); pointSize: Style.fontSizeM; color: Color.mPrimary + icon: PowerProfileService.getIcon() + pointSize: Style.fontSizeM + color: Color.mPrimary } NText { text: I18n.tr("battery.power-profile") @@ -188,7 +192,7 @@ SmartPanel { Layout.fillWidth: true } NText { - text: PowerProfileService.getName() + text: PowerProfileService.getName(profileIndex) color: Color.mOnSurfaceVariant } } @@ -273,7 +277,7 @@ SmartPanel { interval: 1000 repeat: true running: true - onTriggered: manualInhibitActive = manualInhibitorEnabled(); + onTriggered: manualInhibitActive = manualInhibitorEnabled() } Connections { From 3efee10a6bc8385570fd18b71e26b7aa473781b2 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Sat, 22 Nov 2025 11:26:15 -0500 Subject: [PATCH 16/16] Autofmt --- .../Panels/Settings/Tabs/ColorScheme/ColorSchemeTab.qml | 1 - Widgets/NColorPickerDialog.qml | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Modules/Panels/Settings/Tabs/ColorScheme/ColorSchemeTab.qml b/Modules/Panels/Settings/Tabs/ColorScheme/ColorSchemeTab.qml index 8a0e34b7..1839d5e6 100644 --- a/Modules/Panels/Settings/Tabs/ColorScheme/ColorSchemeTab.qml +++ b/Modules/Panels/Settings/Tabs/ColorScheme/ColorSchemeTab.qml @@ -853,7 +853,6 @@ ColumnLayout { } } } - } // Miscellaneous NCollapsible { diff --git a/Widgets/NColorPickerDialog.qml b/Widgets/NColorPickerDialog.qml index b3b777b5..e54e42b5 100644 --- a/Widgets/NColorPickerDialog.qml +++ b/Widgets/NColorPickerDialog.qml @@ -1,11 +1,11 @@ +import QtQml import QtQuick import QtQuick.Controls import QtQuick.Layouts -import QtQml -import qs.Commons -import qs.Widgets -import qs.Services.UI import "../Helpers/ColorList.js" as ColorList +import qs.Commons +import qs.Services.UI +import qs.Widgets Popup { id: root