feat: show the password on the login screen on request

The password field has an eye at its right end that switches the field
between masked and plain text, struck through while the text shows. From
a controller, the queue button toggles it while the field is selected,
and the hint bar says so. A keyboard types into the field, so it uses
the eye instead. It is hidden again each time the login screen opens.
This commit is contained in:
Ansho Rei
2026-11-04 19:06:11 +01:00
parent d4de15acd8
commit 3518462dde
6 changed files with 67 additions and 4 deletions
+11
View File
@@ -451,6 +451,7 @@ impl App {
self.ui.set_screen(Screen::Login);
// Adding a server from inside the app: the bottom button goes back.
self.ui.set_login_can_cancel(self.client.is_some());
self.ui.set_login_password_shown(false);
self.set_login_focus(0);
}
@@ -492,6 +493,12 @@ impl App {
Action::Activate if self.login_focus == 4 => self.action(Action::Quit),
Action::Activate => self.login_submit(),
Action::Back => self.cancel_login(),
// The face button that queues elsewhere; a keyboard types into
// the field instead, and uses the eye.
Action::Queue if self.login_focus == 2 => {
self.ui.set_login_password_shown(!self.ui.get_login_password_shown());
self.render_hints();
}
_ => {}
}
}
@@ -1671,6 +1678,10 @@ impl App {
_ => "Connect",
};
h(Control::Activate, label);
if self.login_focus == 2 && matches!(self.prompts, Prompts::Pad(_)) {
let shown = self.ui.get_login_password_shown();
h(Control::Queue, if shown { "Hide password" } else { "Show password" });
}
if adding {
h(Control::Back, "Cancel");
}