feat: add an Exit button to the login screen

The login screen could only be left with Ctrl+Q, which a gamepad cannot
press. Exit sits below Connect as the last focus stop and goes through
Action::Quit.
This commit is contained in:
Ansho Rei
2026-11-04 13:05:45 +01:00
parent 62169be746
commit 936e28b483
6 changed files with 34 additions and 4 deletions
+8 -2
View File
@@ -370,7 +370,7 @@ impl App {
}
fn set_login_focus(&mut self, i: i32) {
self.login_focus = i.clamp(0, 3);
self.login_focus = i.clamp(0, 4);
self.ui.set_login_focus(self.login_focus);
self.ui.invoke_focus_login(self.login_focus);
self.render_hints();
@@ -381,6 +381,7 @@ impl App {
Action::Up | Action::SectionPrev => self.set_login_focus(self.login_focus - 1),
Action::Down | Action::SectionNext => self.set_login_focus(self.login_focus + 1),
Action::Activate if self.login_focus < 2 => self.set_login_focus(self.login_focus + 1),
Action::Activate if self.login_focus == 4 => self.action(Action::Quit),
Action::Activate => self.login_submit(),
_ => {}
}
@@ -1306,7 +1307,12 @@ impl App {
};
match self.screen {
Screen::Login => {
h(Control::Activate, if self.login_focus < 2 { "Next" } else { "Connect" });
let label = match self.login_focus {
0 | 1 => "Next",
4 => "Exit",
_ => "Connect",
};
h(Control::Activate, label);
}
Screen::Browse => match self.area {
Area::Sidebar => {