From bdad4c47c42646ab8d1f406bcde55a3680cd9a9f Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 30 Apr 2025 14:31:48 +1000 Subject: bar: elide active window title --- modules/bar/components/ActiveWindow.qml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'modules/bar/components/ActiveWindow.qml') diff --git a/modules/bar/components/ActiveWindow.qml b/modules/bar/components/ActiveWindow.qml index 6d8d10e..a4a16e5 100644 --- a/modules/bar/components/ActiveWindow.qml +++ b/modules/bar/components/ActiveWindow.qml @@ -15,18 +15,28 @@ StyledRect { MaterialIcon { id: icon + animate: true text: Icons.getAppCategoryIcon(Hyprland.activeClient?.wmClass, "desktop_windows") color: root.colour } AnchorText { prevAnchor: icon - vertical: root.vertical + + text: metrics.elidedText + font.pointSize: metrics.font.pointSize + font.family: metrics.font.family + color: root.colour + rotation: vertical ? 90 : 0 + } + + TextMetrics { + id: metrics text: Hyprland.activeClient?.title ?? "Desktop" font.pointSize: Appearance.font.size.smaller font.family: Appearance.font.family.mono - color: root.colour - rotation: root.vertical ? 90 : 0 + elide: Qt.ElideRight + elideWidth: root.vertical ? BarConfig.sizes.maxLabelHeight : BarConfig.sizes.maxLabelWidth } } -- cgit v1.2.3-freya