diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-30 14:31:48 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-30 14:31:48 +1000 |
| commit | bdad4c47c42646ab8d1f406bcde55a3680cd9a9f (patch) | |
| tree | e3a62cb6fa2d4938edff047a6bd0681e55d12bc7 /modules | |
| parent | bar: fix workspaces anims (diff) | |
| download | caelestia-shell-bdad4c47c42646ab8d1f406bcde55a3680cd9a9f.tar.gz caelestia-shell-bdad4c47c42646ab8d1f406bcde55a3680cd9a9f.tar.bz2 caelestia-shell-bdad4c47c42646ab8d1f406bcde55a3680cd9a9f.zip | |
bar: elide active window title
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/bar/components/ActiveWindow.qml | 16 | ||||
| -rw-r--r-- | modules/bar/components/workspaces/Workspace.qml | 1 |
2 files changed, 13 insertions, 4 deletions
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 } } diff --git a/modules/bar/components/workspaces/Workspace.qml b/modules/bar/components/workspaces/Workspace.qml index 53f7c59..906cf37 100644 --- a/modules/bar/components/workspaces/Workspace.qml +++ b/modules/bar/components/workspaces/Workspace.qml @@ -32,7 +32,6 @@ Item { readonly property string activeLabel: BarConfig.workspaces.activeLabel || (root.isOccupied ? occupiedLabel : label) animate: true - animateProp: "scale" text: Hyprland.activeWsId === root.ws ? activeLabel : root.isOccupied ? occupiedLabel : label color: BarConfig.workspaces.occupiedBg || root.isOccupied ? Appearance.colours.text : Appearance.colours.subtext0 horizontalAlignment: StyledText.AlignHCenter |