chiark / gitweb /
Fix keystrokes in options menus.
authorSimon Tatham <anakin@pobox.com>
Sat, 3 Feb 2024 09:40:05 +0000 (09:40 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 3 Feb 2024 10:21:42 +0000 (10:21 +0000)
The status line advertised [RET] as a way to get out of the menu, but
handle_keypress() only supported [Q]. Now it supports [RET] too.

Also, [SPACE] is the keypress to submit changes to user-related
options, but the status line forgot to mention it at all! Now it does.

src/options.rs

index b58c90d9311d4122e135c960a094251c43499b6b..9be67ae1f0737720b917424f63056f9becf55495 100644 (file)
@@ -45,8 +45,10 @@ impl YourOptionsMenu {
             "HHHHHHHHHHHHHHHHHHHKKKHHKHHKH",
         ));
 
-        let normal_status =
-            FileStatusLine::new().add(Return, "Back", 10).finalise();
+        let normal_status = FileStatusLine::new()
+            .add(Return, "Back", 10)
+            .add(Space, "Submit Changes", 15)
+            .finalise();
         let edit_status = FileStatusLine::new()
             .message("Edit line and press Return")
             .finalise();
@@ -268,7 +270,7 @@ impl ActivityState for YourOptionsMenu {
 
         match key {
             Space => self.submit(client),
-            Pr('q') | Pr('Q') => LogicalAction::Pop,
+            Pr('q') | Pr('Q') | Return => LogicalAction::Pop,
             Pr('n') | Pr('N') => self.el_display_name.start_editing(),
             Pr('v') | Pr('V') => self.cl_default_vis.cycle(),
             Pr('l') | Pr('L') => self.el_default_language.start_editing(),
@@ -345,8 +347,10 @@ impl OtherUserOptionsMenu {
             'H',
         ));
 
-        let normal_status =
-            FileStatusLine::new().add(Return, "Back", 10).finalise();
+        let normal_status = FileStatusLine::new()
+            .add(Return, "Back", 10)
+            .add(Space, "Submit Changes", 15)
+            .finalise();
         let edit_status = FileStatusLine::new()
             .message("Edit line and press Return")
             .finalise();
@@ -533,7 +537,7 @@ impl ActivityState for OtherUserOptionsMenu {
 
         match key {
             Space => self.submit(client),
-            Pr('q') | Pr('Q') => LogicalAction::Pop,
+            Pr('q') | Pr('Q') | Return => LogicalAction::Pop,
             Pr('f') | Pr('F') => self.cl_follow.cycle(),
             Pr('b') | Pr('B') => self.cl_boosts.cycle(),
             Pr('l') | Pr('L') => self.el_languages.start_editing(),