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
Item {
id: root
required property var bar
readonly property HyprlandMonitor monitor: Hyprland.monitorFor(bar.screen)
readonly property Toplevel activeWindow: ToplevelManager.activeToplevel
height: parent.height
width: colLayout.width
implicitWidth: colLayout.implicitWidth
ColumnLayout {
id: colLayout
@@ -26,7 +26,7 @@ Item {
font.pixelSize: Appearance.font.pixelSize.smaller
color: Appearance.colors.colSubtext
elide: Text.ElideRight
text: activeWindow?.activated ? activeWindow?.appId : qsTr("Desktop")
text: root.activeWindow?.activated ? root.activeWindow?.appId : qsTr("Desktop")
}
StyledText {
@@ -34,7 +34,7 @@ Item {
font.pixelSize: Appearance.font.pixelSize.small
color: Appearance.colors.colOnLayer0
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 {
visible: barRoot.useShortenedForm === 0 && width > 0 && height > 0
visible: barRoot.useShortenedForm === 0
Layout.rightMargin: Appearance.rounding.screenRounding
Layout.fillWidth: true
Layout.fillHeight: true
bar: barRoot
}
}