| ... | ... | @@ -260,13 +260,11 @@ impl State { |
| 260 | 260 | let starting = self.peers.starting.get(&location).cloned(); |
| 261 | 261 | let ui = &mut self.ui; |
| 262 | 262 | let theme = ui.theme.clone(); |
| 263 | | let fields: &[Id] = if host.is_none() && dialog.protect { |
| 264 | | &[password_field()] |
| 265 | | } else { |
| 266 | | &[] |
| 267 | | }; |
| 263 | // Enter takes the dialog's default, Start Sharing or else Done, wherever the focus is |
| 264 | // but on another button. |
| 268 | 265 | let entered = |
| 269 | | ui::popup::navigation(ui, fields, &[NamedKey::Enter]).contains(&NamedKey::Enter); |
| 266 | ui::popup::navigation(ui, &[share_id(), password_field()], &[NamedKey::Enter]) |
| 267 | .contains(&NamedKey::Enter); |
| 270 | 268 | frame(ui, share_id(), "Live Share"); |
| 271 | 269 | text(ui, "notebook", &dialog.library.name, true); |
| 272 | 270 | let (mut start, mut stop, mut copy) = (false, false, None); |
| ... | ... | @@ -384,7 +382,8 @@ impl State { |
| 384 | 382 | start = ui::button(ui, "start", "Start Sharing").clicked || entered; |
| 385 | 383 | } |
| 386 | 384 | } |
| 387 | | let done = ui::button(ui, "done", "Done").clicked; |
| 385 | let offered = host.is_none() && !matches!(starting, Some(None)); |
| 386 | let done = ui::button(ui, "done", "Done").clicked || entered && !offered; |
| 388 | 387 | ui.close(); |
| 389 | 388 | ui.close(); |
| 390 | 389 | if let Some(code) = copy { |
| ... | ... | @@ -443,9 +442,9 @@ impl State { |
| 443 | 442 | } |
| 444 | 443 | } |
| 445 | 444 | let ui = &mut self.ui; |
| 445 | let owners = [join_id(), code_field(), join_password()]; |
| 446 | 446 | let entered = |
| 447 | | ui::popup::navigation(ui, &[code_field(), join_password()], &[NamedKey::Enter]) |
| 448 | | .contains(&NamedKey::Enter); |
| 447 | ui::popup::navigation(ui, &owners, &[NamedKey::Enter]).contains(&NamedKey::Enter); |
| 449 | 448 | frame(ui, join_id(), "Open Shared Notebook"); |
| 450 | 449 | text(ui, "what", "Enter the code from the person sharing.", false); |
| 451 | 450 | labelled(ui, "Code:", |ui| { |