diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-09-16 13:24:57 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-09-16 15:17:48 +0300 |
commit | d862e7bf53eb782a1a5637bbec418a73e513efe4 (patch) | |
tree | b0f684c6b3b54ec9965ff5205cf4dba1cf796324 | |
parent | 005c879a1281ba19e01fcffb9de7fc04393210c8 (diff) |
statustab: don't process scrolling events if account is open
-rw-r--r-- | src/components/mail/status.rs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/components/mail/status.rs b/src/components/mail/status.rs index 3d22d329..4b6c26ad 100644 --- a/src/components/mail/status.rs +++ b/src/components/mail/status.rs @@ -77,12 +77,12 @@ impl Component for StatusPanel { } match *event { - UIEvent::Input(Key::Char('k')) => { + UIEvent::Input(Key::Char('k')) if self.status.is_none() => { self.account_cursor = self.account_cursor.saturating_sub(1); self.dirty = true; return true; } - UIEvent::Input(Key::Char('j')) => { + UIEvent::Input(Key::Char('j')) if self.status.is_none() => { if self.account_cursor + 1 < context.accounts.len() { self.account_cursor += 1; self.dirty = true; @@ -97,28 +97,31 @@ impl Component for StatusPanel { self.status = None; return true; } - UIEvent::Input(Key::Left) => { + UIEvent::Input(Key::Left) if self.status.is_none() => { self.cursor.0 = self.cursor.0.saturating_sub(1); self.dirty = true; return true; } - UIEvent::Input(Key::Right) => { + UIEvent::Input(Key::Right) if self.status.is_none() => { self.cursor.0 = self.cursor.0 + 1; self.dirty = true; return true; } - UIEvent::Input(Key::Up) => { + UIEvent::Input(Key::Up) if self.status.is_none() => { self.cursor.1 = self.cursor.1.saturating_sub(1); self.dirty = true; return true; } - UIEvent::Input(Key::Down) => { + UIEvent::Input(Key::Down) if self.status.is_none() => { self.cursor.1 = self.cursor.1 + 1; self.dirty = true; return true; } - UIEvent::MailboxUpdate(_) => { - self.dirty = true; + UIEvent::MailboxUpdate(_) + | UIEvent::StatusEvent(StatusEvent::NewJob(_)) + | UIEvent::StatusEvent(StatusEvent::JobFinished(_)) + | UIEvent::StatusEvent(StatusEvent::JobCanceled(_)) => { + self.set_dirty(true); } _ => {} } |