diff options
| author | bh <qn+git@excalibur.computer> | 2026-04-17 23:27:29 +0800 |
|---|---|---|
| committer | bh <qn+git@excalibur.computer> | 2026-04-17 23:28:35 +0800 |
| commit | 5c65985f277df4611173b98be01cf0d666b57c4a (patch) | |
| tree | 9686dea9d4c9f011e71e91c8a22e39ec14963a7b | |
| parent | 475ad6b26bd3d8ffb853b327303b439a1a4f4a20 (diff) | |
quickshell: stop hardcoding the window name clamping logic
| -rw-r--r-- | packages.txt | 1 | ||||
| -rw-r--r-- | quickshell/.config/quickshell/shell.qml | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/packages.txt b/packages.txt index f804104..c6a5707 100644 --- a/packages.txt +++ b/packages.txt @@ -43,6 +43,7 @@ cmake ninja clang gcc +musl rust go zig diff --git a/quickshell/.config/quickshell/shell.qml b/quickshell/.config/quickshell/shell.qml index 1281878..a64a472 100644 --- a/quickshell/.config/quickshell/shell.qml +++ b/quickshell/.config/quickshell/shell.qml @@ -62,6 +62,7 @@ PanelWindow { // ║ 🏢 CENTER: WORKSPACES ║ // ╚══════════════════════════════════════════════════════════════╝ RowLayout { + id: workspacesRow anchors.centerIn: parent spacing: 12 @@ -257,6 +258,7 @@ PanelWindow { // ── 🪟 Window Title ─────────────────────────────────────── Rectangle { + id: windowModule color: root.bg2 Layout.fillHeight: true implicitWidth: windowRow.implicitWidth + 16 @@ -278,11 +280,9 @@ PanelWindow { color: root.fg font.family: "Source Code Pro" font.pixelSize: 14 - text: { - var title = Hyprland.activeToplevel?.title ?? "" - if (title.length > 50) return title.substring(0, 47) + "..." - return title - } + property string fullTitle: Hyprland.activeToplevel?.title ?? "" + property int maxChars: Math.max(5, Math.floor((workspacesRow.x - windowModule.x - 80) / 8)) + text: fullTitle.length > maxChars ? fullTitle.substring(0, maxChars - 3) + "..." : fullTitle } } } |
