Canvas · Graphs and boards: a field hands focus back on Enter and Escape
writing::begin records the owner's focus, the mind map's or the tool layer's, through forms::Editing::returning. The field keeps its words on Enter's release and drops them on Escape, and both hand focus back, so the map's arrows and the board's Backspace work at once after a write.
This commit is contained in:
1 parent
538c3ed93f
commit
31bd483dc5
8 files changed
+81
-12
No files matched your search
+2
-2
@@ -54,11 +54,11 @@ impl Editing {
|
||||
}
|
||||
|
||||
/// Focus goes back here after Enter or Escape.
|
||||
fn returning(&mut self, back: FocusHandle) {
|
||||
pub(crate) fn returning(&mut self, back: FocusHandle) {
|
||||
self.back = Some(back);
|
||||
}
|
||||
|
||||
fn give_back(&mut self, window: &mut Window) {
|
||||
pub(crate) fn give_back(&mut self, window: &mut Window) {
|
||||
if let Some(back) = self.back.take() {
|
||||
log::info!("inline edit: focus handed back");
|
||||
window.focus(&back);
|
||||
|
||||
Reference in new issue
Block a user