fix active window title not showing

This commit is contained in:
end-4
2025-06-13 17:36:48 +02:00
parent dc24541f61
commit c882b162d2
2 changed files with 6 additions and 5 deletions
@@ -6,12 +6,12 @@ import Quickshell.Wayland
import Quickshell.Hyprland import Quickshell.Hyprland
Item { Item {
id: root
required property var bar required property var bar
readonly property HyprlandMonitor monitor: Hyprland.monitorFor(bar.screen) readonly property HyprlandMonitor monitor: Hyprland.monitorFor(bar.screen)
readonly property Toplevel activeWindow: ToplevelManager.activeToplevel readonly property Toplevel activeWindow: ToplevelManager.activeToplevel
height: parent.height implicitWidth: colLayout.implicitWidth
width: colLayout.width
ColumnLayout { ColumnLayout {
id: colLayout id: colLayout
@@ -26,7 +26,7 @@ Item {
font.pixelSize: Appearance.font.pixelSize.smaller font.pixelSize: Appearance.font.pixelSize.smaller
color: Appearance.colors.colSubtext color: Appearance.colors.colSubtext
elide: Text.ElideRight elide: Text.ElideRight
text: activeWindow?.activated ? activeWindow?.appId : qsTr("Desktop") text: root.activeWindow?.activated ? root.activeWindow?.appId : qsTr("Desktop")
} }
StyledText { StyledText {
@@ -34,7 +34,7 @@ Item {
font.pixelSize: Appearance.font.pixelSize.small font.pixelSize: Appearance.font.pixelSize.small
color: Appearance.colors.colOnLayer0 color: Appearance.colors.colOnLayer0
elide: Text.ElideRight elide: Text.ElideRight
text: activeWindow?.activated ? activeWindow?.title : `${qsTr("Workspace")} ${monitor.activeWorkspace?.id}` text: root.activeWindow?.activated ? root.activeWindow?.title : `${qsTr("Workspace")} ${monitor.activeWorkspace?.id}`
} }
} }
+2 -1
View File
@@ -176,9 +176,10 @@ Scope {
} }
ActiveWindow { ActiveWindow {
visible: barRoot.useShortenedForm === 0 && width > 0 && height > 0 visible: barRoot.useShortenedForm === 0
Layout.rightMargin: Appearance.rounding.screenRounding Layout.rightMargin: Appearance.rounding.screenRounding
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true
bar: barRoot bar: barRoot
} }
} }