mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-26 22:42:50 -05:00
bar(ws): add option to show name (#1223)
This commit is contained in:
@@ -565,6 +565,17 @@ Item {
|
||||
if (isPlaceholder)
|
||||
return index + 1;
|
||||
|
||||
if (SettingsData.showWorkspaceName) {
|
||||
let workspaceName = modelData?.name;
|
||||
|
||||
if (workspaceName && workspaceName !== "") {
|
||||
if (root.isVertical) {
|
||||
return workspaceName.charAt(0);
|
||||
}
|
||||
return workspaceName;
|
||||
}
|
||||
}
|
||||
|
||||
if (root.useExtWorkspace)
|
||||
return index + 1;
|
||||
if (CompositorService.isHyprland)
|
||||
@@ -942,7 +953,7 @@ Item {
|
||||
id: rowLayout
|
||||
Row {
|
||||
spacing: 4
|
||||
visible: loadedIcons.length > 0 || SettingsData.showWorkspaceIndex || loadedHasIcon
|
||||
visible: loadedIcons.length > 0 || SettingsData.showWorkspaceIndex || SettingsData.showWorkspaceName || loadedHasIcon
|
||||
|
||||
Item {
|
||||
visible: loadedHasIcon && loadedIconData?.type === "icon"
|
||||
@@ -975,7 +986,7 @@ Item {
|
||||
}
|
||||
|
||||
Item {
|
||||
visible: SettingsData.showWorkspaceIndex && !loadedHasIcon
|
||||
visible: (SettingsData.showWorkspaceIndex || SettingsData.showWorkspaceName) && !loadedHasIcon
|
||||
width: wsIndexText.implicitWidth + (isActive && loadedIcons.length > 0 ? 4 : 0)
|
||||
height: root.appIconSize
|
||||
|
||||
@@ -1072,7 +1083,7 @@ Item {
|
||||
id: columnLayout
|
||||
Column {
|
||||
spacing: 4
|
||||
visible: loadedIcons.length > 0 || loadedHasIcon
|
||||
visible: loadedIcons.length > 0 || SettingsData.showWorkspaceIndex || SettingsData.showWorkspaceName || loadedHasIcon
|
||||
|
||||
DankIcon {
|
||||
visible: loadedHasIcon && loadedIconData?.type === "icon"
|
||||
@@ -1209,7 +1220,7 @@ Item {
|
||||
Loader {
|
||||
id: indexLoader
|
||||
anchors.fill: parent
|
||||
active: SettingsData.showWorkspaceIndex && !loadedHasIcon && !SettingsData.showWorkspaceApps
|
||||
active: (SettingsData.showWorkspaceIndex || SettingsData.showWorkspaceName) && !loadedHasIcon && !SettingsData.showWorkspaceApps
|
||||
sourceComponent: Item {
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
|
||||
@@ -35,6 +35,15 @@ Item {
|
||||
onToggled: checked => SettingsData.set("showWorkspaceIndex", checked)
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "showWorkspaceName"
|
||||
tags: ["workspace", "name", "labels"]
|
||||
text: I18n.tr("Workspace Names")
|
||||
description: I18n.tr("Show workspace name on horizontal bars, and first letter on vertical bars")
|
||||
checked: SettingsData.showWorkspaceName
|
||||
onToggled: checked => SettingsData.set("showWorkspaceName", checked)
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "showWorkspacePadding"
|
||||
tags: ["workspace", "padding", "minimum"]
|
||||
|
||||
Reference in New Issue
Block a user