diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-04-27 19:53:33 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-06-10 19:40:45 +0300 |
commit | de8b733d92bf123beed9ddcf5149c6a587409fee (patch) | |
tree | 2e16bf9537892f63e08d077076e6d92227d0837e | |
parent | 72d347eb6b9ffa1e301be462c1f0300293ce1737 (diff) |
ui: initialize cursor in AccountMenu
Previous behavior was cursor highlight jumping around freshly loaded
folders
-rw-r--r-- | ui/src/components/mail.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/ui/src/components/mail.rs b/ui/src/components/mail.rs index be53b820..b8c6780f 100644 --- a/ui/src/components/mail.rs +++ b/ui/src/components/mail.rs @@ -73,7 +73,7 @@ impl AccountMenu { accounts, visible: true, dirty: true, - cursor: None, + cursor: Some((0, 0)), id: ComponentId::new_v4(), } } @@ -277,14 +277,6 @@ impl Component for AccountMenu { fn process_event(&mut self, event: &mut UIEvent, context: &mut Context) -> bool { match *event { UIEvent::RefreshMailbox((idxa, folder_hash)) => { - self.cursor = Some(( - idxa, - context.accounts[idxa] - .folders_order - .iter() - .position(|&h| h == folder_hash) - .unwrap_or(0), - )); self.dirty = true; } UIEvent::ChangeMode(UIMode::Normal) => { |