diff --git a/Modules/Bar/Widgets/TaskbarGrouped.qml b/Modules/Bar/Widgets/TaskbarGrouped.qml index 89beb15f..25bf8b00 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 { @@ -392,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() diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index 4df0018d..afff80ca 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, 1)) + } } + 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..0c702563 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.index+name") } ] currentKey: widgetData.labelMode || widgetMetadata.labelMode