On escape, close context menus before clearing selection
This commit is contained in:
parent
e9b25a65c2
commit
afa0903120
1 changed files with 4 additions and 2 deletions
|
|
@ -948,7 +948,10 @@ impl Application for App {
|
||||||
// Why: It'd be weird to close everything all at once
|
// Why: It'd be weird to close everything all at once
|
||||||
// Usually, the Escape key (for example) closes menus and panes one by one instead
|
// Usually, the Escape key (for example) closes menus and panes one by one instead
|
||||||
// of closing everything on one press
|
// of closing everything on one press
|
||||||
// TODO: Close MenuBar too
|
if self.core.window.show_context {
|
||||||
|
self.core.window.show_context = false;
|
||||||
|
return Command::none();
|
||||||
|
}
|
||||||
if let Some(tab) = self.tab_model.data_mut::<Tab>(entity) {
|
if let Some(tab) = self.tab_model.data_mut::<Tab>(entity) {
|
||||||
if tab.context_menu.is_some() {
|
if tab.context_menu.is_some() {
|
||||||
tab.context_menu = None;
|
tab.context_menu = None;
|
||||||
|
|
@ -964,7 +967,6 @@ impl Application for App {
|
||||||
return Command::none();
|
return Command::none();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.core.window.show_context = false;
|
|
||||||
|
|
||||||
Command::none()
|
Command::none()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue