font browser
fix: register the picker's Cancel / Select only in select mode
Registered always, they sat unplaced at the window's corner as the first two
stops of the Tab walk (now on by default) and of the accessibility tree.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
src/main.rs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/main.rs b/src/main.rs
index dafb987..d7e2d60 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -297,8 +297,13 @@ impl TypefaceApp {
self.ui_context.register_host(&mut self.style_dropdown);
self.ui_context.register_host(&mut self.size_spinbox);
self.ui_context.register_host(&mut self.preview_box);
- self.ui_context.register_host(&mut self.select_cancel_btn);
- self.ui_context.register_host(&mut self.select_confirm_btn);
+ // The picker's Cancel / Select exist only in select mode (`--select`), where they
+ // are laid out and drawn; registered otherwise they sat unplaced at the window's
+ // corner as the first two stops of the Tab walk and the accessibility tree.
+ if self.select_mode {
+ self.ui_context.register_host(&mut self.select_cancel_btn);
+ self.ui_context.register_host(&mut self.select_confirm_btn);
+ }
}
for btn in self.font_buttons.iter_mut() {
if btn.rect().0 > -9000.0 {