T60: removing a fallback drops that row's input and the focus, so no input keeps, or saves on Enter, the family removed; gpui's Linux path, which carries a second fallback into the next character, is recorded as the owner chose

This commit is contained in:
ZacharyZhang-NY committed 2026-10-19 17:38:32 -04:00
1 parent cb32f00623
commit 5f8ea89838
3 files changed
+16 -12

No files matched your search

+14 -10
View File
@@ -217,15 +217,16 @@ impl SettingsWindow {
.on_change(pick(&this, index));
let remove = IconButton::new(("remove_fallback", index), IconName::X).on_click({
let (this, family) = (this.clone(), family.clone());
move |_, _, cx| {
set(
&this,
format!("font_fallbacks drops {family:?}"),
cx,
|settings| {
settings.font_fallbacks.remove(index);
},
);
move |_, window, cx| {
let dropped = format!("font_fallbacks drops {family:?}");
let removed = set(&this, dropped, cx, |settings| {
settings.font_fallbacks.remove(index);
});
// Each input left keeps its own family, and none the dropped one.
if removed {
this.update(cx, |this, _| this.fallbacks.remove(index));
window.blur(cx);
}
}
});
row(index, picker, remove)
@@ -236,7 +237,10 @@ impl SettingsWindow {
.on_change(pick(&this, next));
let cancel = IconButton::new("cancel_fallback", IconName::X).on_click({
let this = this.clone();
move |_, _, cx| this.update(cx, |this, cx| this.leave_adding(cx))
move |_, window, cx| {
this.update(cx, |this, cx| this.leave_adding(cx));
window.blur(cx);
}
});
row(next, picker, cancel)
} else {