clamp active window text to 1/4 of bar length

This commit is contained in:
lucy 2026-08-29 19:22:30 +02:00
commit 1cbccb7199
2 changed files with 12 additions and 8 deletions

View file

@ -1,18 +1,22 @@
pragma ComponentBehavior: Bound
import Quickshell.Widgets
import Quickshell.Wayland
import Quickshell
import QtQuick
import QtQuick.Layouts
import qs
import qs.widgets
import qs.settings
BarComponent {
id: root
required property ShellScreen screen
implicitWidth: windowText.implicitWidth + 16
StyledText {
RowLayout {
id: windowText
anchors.centerIn: parent
StyledText {
Layout.maximumWidth: root.screen.width / 4
text: ToplevelManager.activeToplevel?.title ?? "Desktop"
elide: Text.ElideRight
}
}
}

View file

@ -33,7 +33,7 @@ Variants {
Ws {
barScreen: root.modelData
}
ActiveWindow {}
ActiveWindow {screen: root.modelData}
}
RowLayout {
anchors.centerIn: parent