fix(settings): action menus don't reserve a column for a tick

Every settings menu kept an empty tick column, so a menu of actions
(an agent's Reinstall / Reveal / Uninstall) set its labels 24px in from
a 12px right edge. The column is kept only when some entry is ticked -
a choice menu - and an action menu is padded evenly.
This commit is contained in:
l0ng-ai
2026-09-27 16:50:19 +02:00
parent 29d821c6e1
commit 6bf500dba7
2 changed files with 11 additions and 2 deletions
+3 -1
View File
@@ -513,7 +513,9 @@ pub fn translate_ja(key: L10nKey) -> Option<&'static str> {
L10nKey::SettingsOn => "オン",
L10nKey::SettingsOff => "オフ",
L10nKey::SettingsShell => "シェル",
L10nKey::SettingsShellIntro => "新しいターミナルで起動するプログラム。空欄なら{default}を使います。",
L10nKey::SettingsShellIntro => {
"新しいターミナルで起動するプログラム。空欄なら{default}を使います。"
}
L10nKey::SettingsProgram => "シェルプログラム",
L10nKey::SettingsProgramDesc => "PATH 上の名前か絶対パス。例: zsh、fish",
L10nKey::SettingsArguments => "シェル引数",
+8 -1
View File
@@ -158,6 +158,12 @@ impl Tty7App {
) -> Div {
let tk = Tk::of(cx);
let mut panel = kit::menu_panel(&tk);
// A choice menu keeps a column for its tick so the labels line up
// whichever one is picked. A menu of actions ticks nothing, and the
// same empty column left its labels 24px in from a 12px right edge.
let ticks = entries
.iter()
.any(|e| matches!(e, MenuEntry::Item { checked: true, .. }));
for (i, entry) in entries.into_iter().enumerate() {
panel = match entry {
MenuEntry::Item {
@@ -173,7 +179,8 @@ impl Tty7App {
false,
&tk,
)
.child(kit::check_mark(checked, &tk))
.when(ticks, |r| r.child(kit::check_mark(checked, &tk)))
.when(!ticks, |r| r.pl(px(12.)))
.child(
div()
.flex_1()