From 8ec6040c298581662ecaea9547581edc72ca3093 Mon Sep 17 00:00:00 2001 From: Corey Woodworth Date: Sun, 16 Nov 2025 19:42:30 -0500 Subject: [PATCH 1/3] A little visual cleanup to TasbarGrouped, and added Name+Index option to Workspace widget too. --- Modules/Bar/Widgets/TaskbarGrouped.qml | 3 +- Modules/Bar/Widgets/Workspace.qml | 47 +++++++++++++------ .../WidgetSettings/TaskbarGroupedSettings.qml | 3 +- .../Bar/WidgetSettings/WorkspaceSettings.qml | 4 ++ 4 files changed, 40 insertions(+), 17 deletions(-) diff --git a/Modules/Bar/Widgets/TaskbarGrouped.qml b/Modules/Bar/Widgets/TaskbarGrouped.qml index 89beb15f..1115083a 100644 --- a/Modules/Bar/Widgets/TaskbarGrouped.qml +++ b/Modules/Bar/Widgets/TaskbarGrouped.qml @@ -329,7 +329,8 @@ Item { topMargin: -Style.fontSizeXS * 0.5 } - width: Math.max(workspaceNumber.implicitWidth + Style.marginXS, Style.fontSizeXXS * 2) + // Doube width margin necessary here for Name or Name+Index, but double height not needed. + width: Math.max(workspaceNumber.implicitWidth + (Style.marginXS * 2), Style.fontSizeXXS * 2) height: Math.max(workspaceNumber.implicitHeight + Style.marginXS, Style.fontSizeXXS * 2) Rectangle { diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index 4df0018d..cdaac3f6 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -71,15 +71,24 @@ Item { const d = Style.capsuleHeight * root.baseDimensionRatio; const factor = ws.isActive ? 2.2 : 1; - // For name mode, calculate width based on actual text content - if (labelMode === "name" && ws.name && ws.name.length > 0) { - const displayText = ws.name.substring(0, characterCount); - const textWidth = displayText.length * (d * 0.4); // Approximate width per character - const padding = d * 0.6; // Padding on both sides - return Math.max(d * factor, textWidth + padding); + // Don't calculate text width if labels are off + if (labelMode === "none") { + return d * factor; } - return d * factor; + var displayText = ws.idx.toString(); + + if (ws.name && ws.name.length > 0) { + if (root.labelMode === "name") { + displayText = ws.name.substring(0, characterCount); + } else if (root.labelMode === "index+name") { + displayText = ws.idx.toString() + " " + ws.name.substring(0, characterCount); + } + } + + const textWidth = displayText.length * (d * 0.4); // Approximate width per character + const padding = d * 0.6; + return Math.max(d * factor, textWidth + padding); } function getWorkspaceHeight(ws) { @@ -289,11 +298,15 @@ Item { x: (pill.width - width) / 2 y: (pill.height - height) / 2 + (height - contentHeight) / 2 text: { - if (labelMode === "name" && model.name && model.name.length > 0) { - return model.name.substring(0, characterCount); - } else { - return model.idx.toString(); + if (model.name && model.name.length > 0) { + if (root.labelMode === "name") { + return model.name.substring(0, characterCount); + } + if (root.labelMode === "index+name") { + return (model.idx.toString() + " " + model.name.substring(0, characterCount)) + } } + return model.idx.toString(); } family: Settings.data.ui.fontFixed pointSize: model.isActive ? workspacePillContainer.height * 0.45 : workspacePillContainer.height * 0.42 @@ -434,11 +447,15 @@ Item { x: (pillVertical.width - width) / 2 y: (pillVertical.height - height) / 2 + (height - contentHeight) / 2 text: { - if (labelMode === "name" && model.name && model.name.length > 0) { - return model.name.substring(0, characterCount); - } else { - return model.idx.toString(); + if (model.name && model.name.length > 0) { + if (root.labelMode === "name") { + return model.name.substring(0, characterCount); + } + if (root.labelMode === "index+name") { + return (model.idx.toString() + " " + model.name.substring(0, characterCount)) + } } + return model.idx.toString(); } family: Settings.data.ui.fontFixed pointSize: model.isActive ? workspacePillContainerVertical.width * 0.45 : workspacePillContainerVertical.width * 0.42 diff --git a/Modules/Panels/Settings/Bar/WidgetSettings/TaskbarGroupedSettings.qml b/Modules/Panels/Settings/Bar/WidgetSettings/TaskbarGroupedSettings.qml index ac9d46ef..98cf4a98 100644 --- a/Modules/Panels/Settings/Bar/WidgetSettings/TaskbarGroupedSettings.qml +++ b/Modules/Panels/Settings/Bar/WidgetSettings/TaskbarGroupedSettings.qml @@ -44,7 +44,8 @@ ColumnLayout { { "key": "name", "name": I18n.tr("options.workspace-labels.name") - }, { + }, + { "key": "index+name", "name": I18n.tr("options.workspace-labels.index+name") }] diff --git a/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml b/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml index 5800cff6..4e626e52 100644 --- a/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml +++ b/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml @@ -40,6 +40,10 @@ ColumnLayout { { "key": "name", "name": I18n.tr("options.workspace-labels.name") + }, + { + "key": "index+name", + "name": I18n.tr("options.workspace-labels.name+index") } ] currentKey: widgetData.labelMode || widgetMetadata.labelMode From 064b894fbcf5a95d149d09766049ce82db7cffc1 Mon Sep 17 00:00:00 2001 From: Corey Woodworth Date: Sun, 16 Nov 2025 19:55:19 -0500 Subject: [PATCH 2/3] Bugfixes. Wrong setting label, and better vertical bar support --- Modules/Bar/Widgets/Workspace.qml | 2 +- .../Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index cdaac3f6..afff80ca 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -452,7 +452,7 @@ Item { return model.name.substring(0, characterCount); } if (root.labelMode === "index+name") { - return (model.idx.toString() + " " + model.name.substring(0, characterCount)) + return (model.idx.toString() + model.name.substring(0, 1)) } } return model.idx.toString(); diff --git a/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml b/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml index 4e626e52..0c702563 100644 --- a/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml +++ b/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml @@ -43,7 +43,7 @@ ColumnLayout { }, { "key": "index+name", - "name": I18n.tr("options.workspace-labels.name+index") + "name": I18n.tr("options.workspace-labels.index+name") } ] currentKey: widgetData.labelMode || widgetMetadata.labelMode From 1f0485dff277d1af890dc3c29939e7d8caa1e742 Mon Sep 17 00:00:00 2001 From: Corey Woodworth Date: Sun, 16 Nov 2025 20:09:14 -0500 Subject: [PATCH 3/3] Bugfixes. Better Vertical Bar Support --- Modules/Bar/Widgets/TaskbarGrouped.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Bar/Widgets/TaskbarGrouped.qml b/Modules/Bar/Widgets/TaskbarGrouped.qml index 1115083a..25bf8b00 100644 --- a/Modules/Bar/Widgets/TaskbarGrouped.qml +++ b/Modules/Bar/Widgets/TaskbarGrouped.qml @@ -393,7 +393,7 @@ Item { return workspaceModel.name.substring(0, root.characterCount) } if (root.labelMode === "index+name") { - return (workspaceModel.idx.toString() + " " + workspaceModel.name.substring(0, root.characterCount)) + return (workspaceModel.idx.toString() + workspaceModel.name.substring(0, 1)) } } return workspaceModel.idx.toString()