feat: replace the login screen's Exit button with an X in the corner

The full-width button under Connect took a row in a card that is close
to filling an 800 px high screen. The X is a focus stop between the
saved servers and the address field, so Up from the address field still
reaches it from a controller.

Bumps the version to 0.10.1.
This commit is contained in:
Ansho Rei
2026-11-06 23:35:37 +01:00
parent 5bb42ba834
commit f03374b585
6 changed files with 53 additions and 35 deletions
+6
View File
@@ -2,6 +2,12 @@
One section per version, newest first. One section per version, newest first.
## v0.10.1 (2026-11-06)
### Features
- Exit on the login screen is an X in the top right corner of the card instead of a button under Connect, which makes the card shorter. Up from the address field reaches it on a controller. When adding a server it cancels, as the button did.
## v0.10.0 (2026-11-06) ## v0.10.0 (2026-11-06)
### Features ### Features
Generated
+1 -1
View File
@@ -4385,7 +4385,7 @@ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
[[package]] [[package]]
name = "remus" name = "remus"
version = "0.10.0" version = "0.10.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"directories", "directories",
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "remus" name = "remus"
version = "0.10.0" version = "0.10.1"
edition = "2024" edition = "2024"
license = "MIT" license = "MIT"
@@ -20,6 +20,7 @@
</supports> </supports>
<content_rating type="oars-1.1"/> <content_rating type="oars-1.1"/>
<releases> <releases>
<release version="0.10.1" date="2026-11-06"/>
<release version="0.10.0" date="2026-11-06"/> <release version="0.10.0" date="2026-11-06"/>
<release version="0.9.1" date="2026-11-06"/> <release version="0.9.1" date="2026-11-06"/>
<release version="0.9.0" date="2026-11-05"/> <release version="0.9.0" date="2026-11-05"/>
+18 -17
View File
@@ -584,15 +584,15 @@ impl App {
self.set_area(area); self.set_area(area);
} }
/// 0 to 2 are the fields and 3 and 4 the buttons. Below 0 are the saved /// Top to bottom: the saved servers in the card beside the form, from
/// servers in the card beside the form, from the top one at -n to the /// -n-1 to -2; the X in the form's corner at -1; the fields 0 to 2; and
/// bottom one at -1, so Up from the address field reaches the list. /// Connect at 3. So Up from the address field reaches the X, then the list.
fn set_login_focus(&mut self, i: i32) { fn set_login_focus(&mut self, i: i32) {
let known = self.logins.servers.len() as i32; let known = self.logins.servers.len() as i32;
self.login_focus = i.clamp(-known, 4); self.login_focus = i.clamp(-known - 1, 3);
self.ui.set_login_focus(self.login_focus); self.ui.set_login_focus(self.login_focus);
self.ui.set_login_known_selected(if self.login_focus < 0 { self.ui.set_login_known_selected(if self.login_focus < -1 {
known + self.login_focus known + 1 + self.login_focus
} else { } else {
-1 -1
}); });
@@ -606,16 +606,16 @@ impl App {
Action::Down | Action::SectionNext => self.set_login_focus(self.login_focus + 1), Action::Down | Action::SectionNext => self.set_login_focus(self.login_focus + 1),
// Across to the saved servers and back. A text field keeps Left // Across to the saved servers and back. A text field keeps Left
// and Right on a keyboard for its cursor. // and Right on a keyboard for its cursor.
Action::Left if self.login_focus >= 0 && !self.logins.servers.is_empty() => { Action::Left if self.login_focus >= -1 && !self.logins.servers.is_empty() => {
self.set_login_focus(-(self.logins.servers.len() as i32)) self.set_login_focus(-(self.logins.servers.len() as i32) - 1)
} }
Action::Right if self.login_focus < 0 => self.set_login_focus(0), Action::Right if self.login_focus < -1 => self.set_login_focus(0),
Action::Activate if self.login_focus < 0 => { Action::Activate if self.login_focus < -1 => {
self.pick_known((self.logins.servers.len() as i32 + self.login_focus) as usize) self.pick_known((self.logins.servers.len() as i32 + 1 + self.login_focus) as usize)
} }
Action::Activate if self.login_focus == -1 && self.client.is_some() => self.cancel_login(),
Action::Activate if self.login_focus == -1 => self.action(Action::Quit),
Action::Activate if self.login_focus < 2 => 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.client.is_some() => self.cancel_login(),
Action::Activate if self.login_focus == 4 => self.action(Action::Quit),
Action::Activate => self.login_submit(), Action::Activate => self.login_submit(),
Action::Back => self.cancel_login(), Action::Back => self.cancel_login(),
// The face button that queues elsewhere; a keyboard types into // The face button that queues elsewhere; a keyboard types into
@@ -2051,10 +2051,10 @@ impl App {
Screen::Login => { Screen::Login => {
let adding = self.client.is_some(); let adding = self.client.is_some();
let label = match self.login_focus { let label = match self.login_focus {
..0 => "Use this server", ..-1 => "Use this server",
-1 if adding => "Cancel",
-1 => "Exit",
0 | 1 => "Next", 0 | 1 => "Next",
4 if adding => "Cancel",
4 => "Exit",
_ => "Connect", _ => "Connect",
}; };
h(Control::Activate, label); h(Control::Activate, label);
@@ -2062,7 +2062,8 @@ impl App {
let shown = self.ui.get_login_password_shown(); let shown = self.ui.get_login_password_shown();
h(Control::Queue, if shown { "Hide password" } else { "Show password" }); h(Control::Queue, if shown { "Hide password" } else { "Show password" });
} }
if adding { // Already the activate hint while the X has focus.
if adding && self.login_focus != -1 {
h(Control::Back, "Cancel"); h(Control::Back, "Cancel");
} }
} }
+26 -16
View File
@@ -1101,21 +1101,6 @@ component LoginView inherits Rectangle {
clicked => { root.submit(); } clicked => { root.submit(); }
} }
} }
// Secondary to Connect: outlined, no fill, and only lit when focused.
Rectangle {
height: 46px * Theme.s;
border-radius: 12px * Theme.s;
border-width: 2px * Theme.s;
border-color: root.focus-index == 4 ? Theme.focus : Theme.line;
Text {
text: root.can-cancel ? "Cancel" : "Exit";
font-size: 17px * Theme.s;
color: root.focus-index == 4 ? Theme.text : Theme.muted;
}
TouchArea {
clicked => { root.exit(); }
}
}
if root.error != "": Text { if root.error != "": Text {
text: root.error; text: root.error;
font-size: 15px * Theme.s; font-size: 15px * Theme.s;
@@ -1129,6 +1114,31 @@ component LoginView inherits Rectangle {
wrap: word-wrap; wrap: word-wrap;
} }
} }
// Exit, or Cancel when adding a server from inside the app. A
// corner button rather than a row, to keep the card short.
Rectangle {
x: parent.width - self.width - 14px * Theme.s;
y: 14px * Theme.s;
width: 44px * Theme.s;
height: 44px * Theme.s;
border-radius: self.width / 2;
background: root.focus-index == -1 || x-area.has-hover ? Theme.raised : transparent;
border-width: 2px * Theme.s;
border-color: root.focus-index == -1 ? Theme.focus : transparent;
Path {
width: 18px * Theme.s;
height: 18px * Theme.s;
viewbox-width: 24;
viewbox-height: 24;
commands: "M 4 4 L 20 20 M 20 4 L 4 20";
stroke: root.focus-index == -1 || x-area.has-hover ? Theme.text : Theme.muted;
stroke-width: 2px * Theme.s;
}
x-area := TouchArea {
clicked => { root.exit(); }
}
}
} }
} }
} }
@@ -1419,7 +1429,7 @@ export component AppWindow inherits Window {
search.focus-input(); search.focus-input();
} }
public function focus-login(i: int) { public function focus-login(i: int) {
// Below 0 is a saved server, above 2 a button: keys go to the scope. // Below 0 is the X or a saved server, 3 is Connect: keys go to the scope.
if (i >= 3 || i < 0) { if (i >= 3 || i < 0) {
fs.focus(); fs.focus();
} else { } else {