1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-11-25 07:06:48 +01:00

quickshell: fix window title overflow

This commit is contained in:
Henrik Hautakoski 2026-11-21 15:35:35 +01:00
parent 1653148595
commit e5d19bd3ab
2 changed files with 28 additions and 13 deletions

View file

@ -26,20 +26,29 @@ PanelWindow {
right: true
}
BarSection {
id: leftContainer
anchors.left: parent.left
anchors.leftMargin: root.marginLeft
}
Item {
anchors.fill: parent
BarSection {
id: centerContainer
anchors.horizontalCenter: parent.horizontalCenter
}
BarSection {
id: leftContainer
anchors.left: parent.left
anchors.leftMargin: root.marginLeft
}
BarSection {
id: rightContainer
anchors.right: parent.right
anchors.rightMargin: root.marginRight
BarSection {
id: centerContainer
anchors.horizontalCenter: parent.horizontalCenter
width: Math.min(implicitWidth, Math.max(0, 2 * Math.min(
parent.width / 2 - (leftContainer.x + leftContainer.width),
rightContainer.x - parent.width / 2
)))
clip: true
}
BarSection {
id: rightContainer
anchors.right: parent.right
anchors.rightMargin: root.marginRight
}
}
}

View file

@ -1,6 +1,7 @@
import Quickshell
import Quickshell.Hyprland
import QtQuick
import QtQuick.Layouts
Item {
property int paddingY: 4
@ -11,6 +12,8 @@ Item {
implicitWidth: label.implicitWidth + root.paddingX
implicitHeight: label.implicitHeight + root.paddingY
Layout.minimumWidth: 0
Layout.fillWidth: true
SystemPalette { id: pal }
@ -22,8 +25,11 @@ Item {
Text {
id: label
anchors.centerIn: parent
width: Math.max(0, parent.width - root.paddingX)
text: Hyprland.activeToplevel?.title ?? ""
// text: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
color: pal.text
elide: Text.ElideRight
}
}
}