fix: room between tray submenu labels and the chevron #8

Merged
jfro merged 1 commit from fix/3-tray-chevron-spacing into main 2026-11-29 00:39:36 +00:00
Owner

Closes #3

Tray hosts draw the DBusMenu themselves and it has no spacing property, so the only thing Krane controls is the label text. This adds submenu_label() in src/tray.rs, which puts 4 trailing spaces on the three SubMenu labels (Stopped · N, compose project, container). Standard items are unchanged. Research and measurements are in Nye's comment on #3; patch by Nye.

Breeze (Qt 6.8), before / after: the gap between the widest label and the chevron goes from about 16px to about 31px.

Breeze before/after

XFCE panel (GTK3), after, with a sandbox compose project and a stopped container:

XFCE after

Checked: cargo build finishes (built with the Qt 6.8 fix from #6 applied on top, since main alone doesn't build on Qt 6.8), and the tray runs and opens its menu on XFCE.

Not in this PR: Nye noticed that _ in container/project names is likely eaten as a mnemonic on every host; escaping _→__ is a possible follow-up.

Closes #3 Tray hosts draw the DBusMenu themselves and it has no spacing property, so the only thing Krane controls is the label text. This adds `submenu_label()` in `src/tray.rs`, which puts 4 trailing spaces on the three `SubMenu` labels (Stopped · N, compose project, container). Standard items are unchanged. Research and measurements are in [Nye's comment on #3](https://git.knope.dev/jfro/krane/issues/3#issuecomment-2245); patch by Nye. **Breeze (Qt 6.8), before / after:** the gap between the widest label and the chevron goes from about 16px to about 31px. ![Breeze before/after](https://git.knope.dev/attachments/2a67cda7-7d45-4007-9212-818f0d5c048e) **XFCE panel (GTK3), after**, with a sandbox compose project and a stopped container: ![XFCE after](https://git.knope.dev/attachments/9ef00664-2a58-4928-b146-99683275bdb5) **Checked:** `cargo build` finishes (built with the Qt 6.8 fix from #6 applied on top, since main alone doesn't build on Qt 6.8), and the tray runs and opens its menu on XFCE. Not in this PR: Nye noticed that `_` in container/project names is likely eaten as a mnemonic on every host; escaping `_`→`__` is a possible follow-up.
jfro left a comment

Review from Nye (posted by Upper Wolfjaw, since Nye's token can't comment). Verdict: Approved.

Approved. It's identical to the patch from my #3 research (ab8db56). With fcbe8a4 cherry-picked it builds on Qt 6.8 and cargo tests pass. It merges cleanly on top of #7. In the running tray (--mock), all 12 submenu labels get 4 trailing spaces and plain items get none, checked over DBusMenu GetLayout. Merge after #6, since main alone doesn't build on Qt 6.8.

Review from Nye (posted by Upper Wolfjaw, since Nye's token can't comment). Verdict: **Approved**. Approved. It's identical to the patch from my #3 research (ab8db56). With fcbe8a4 cherry-picked it builds on Qt 6.8 and cargo tests pass. It merges cleanly on top of #7. In the running tray (--mock), all 12 submenu labels get 4 trailing spaces and plain items get none, checked over DBusMenu GetLayout. Merge after #6, since main alone doesn't build on Qt 6.8.
jfro merged commit 571f4adf74 into main 2026-11-29 00:39:36 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfro/krane!8
No description provided.