ui: Consume Esc input events only when necessary
parent
9757e523bd
commit
4090eecd04
|
@ -726,7 +726,9 @@ impl Component for ContactList {
|
||||||
self.menu_visibility = !self.menu_visibility;
|
self.menu_visibility = !self.menu_visibility;
|
||||||
self.set_dirty(true);
|
self.set_dirty(true);
|
||||||
}
|
}
|
||||||
UIEvent::Input(Key::Esc) | UIEvent::Input(Key::Alt('')) => {
|
UIEvent::Input(Key::Esc) | UIEvent::Input(Key::Alt(''))
|
||||||
|
if !self.cmd_buf.is_empty() =>
|
||||||
|
{
|
||||||
self.cmd_buf.clear();
|
self.cmd_buf.clear();
|
||||||
context
|
context
|
||||||
.replies
|
.replies
|
||||||
|
|
|
@ -816,7 +816,7 @@ impl Component for Listing {
|
||||||
self.get_status(context),
|
self.get_status(context),
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
UIEvent::Input(Key::Esc) | UIEvent::Input(Key::Alt('')) => {
|
UIEvent::Input(Key::Esc) | UIEvent::Input(Key::Alt('')) if !self.cmd_buf.is_empty() => {
|
||||||
self.cmd_buf.clear();
|
self.cmd_buf.clear();
|
||||||
context
|
context
|
||||||
.replies
|
.replies
|
||||||
|
|
|
@ -839,7 +839,7 @@ impl Component for MailView {
|
||||||
self.set_dirty(true);
|
self.set_dirty(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
UIEvent::Input(Key::Esc) | UIEvent::Input(Key::Alt('')) => {
|
UIEvent::Input(Key::Esc) | UIEvent::Input(Key::Alt('')) if !self.cmd_buf.is_empty() => {
|
||||||
self.cmd_buf.clear();
|
self.cmd_buf.clear();
|
||||||
context
|
context
|
||||||
.replies
|
.replies
|
||||||
|
|
|
@ -373,7 +373,7 @@ impl Component for EnvelopeView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
match *event {
|
match *event {
|
||||||
UIEvent::Input(Key::Esc) | UIEvent::Input(Key::Alt('')) => {
|
UIEvent::Input(Key::Esc) | UIEvent::Input(Key::Alt('')) if !self.cmd_buf.is_empty() => {
|
||||||
self.cmd_buf.clear();
|
self.cmd_buf.clear();
|
||||||
context
|
context
|
||||||
.replies
|
.replies
|
||||||
|
|
Loading…
Reference in New Issue