diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2022-12-09 12:45:31 +0200 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2022-12-09 12:49:46 +0200 |
commit | abc56eae431153d2e48f8b1eb3e0d2a140b600d8 (patch) | |
tree | f259e6c59c49d4ff289e3f88a5af6d9d331cb6f7 | |
parent | 7606317f24d076bdc7db873c2b15811728ed946a (diff) | |
download | meli-abc56eae431153d2e48f8b1eb3e0d2a140b600d8.zip |
mail/listing: fix SEEN flag update hiding mail view momentarily
-rw-r--r-- | src/components/mail/listing/compact.rs | 14 | ||||
-rw-r--r-- | src/components/mail/listing/conversations.rs | 14 | ||||
-rw-r--r-- | src/components/mail/listing/plain.rs | 12 | ||||
-rw-r--r-- | src/components/mail/listing/thread.rs | 16 |
4 files changed, 28 insertions, 28 deletions
diff --git a/src/components/mail/listing/compact.rs b/src/components/mail/listing/compact.rs index 3ddc89c6..ed90dd28 100644 --- a/src/components/mail/listing/compact.rs +++ b/src/components/mail/listing/compact.rs @@ -242,7 +242,7 @@ impl MailListingTrait for CompactListing { /// Fill the `self.data_columns` `CellBuffers` with the contents of the account mailbox the user has /// chosen. fn refresh_mailbox(&mut self, context: &mut Context, force: bool) { - self.dirty = true; + self.set_dirty(true); self.rows.clear(); let old_cursor_pos = self.cursor_pos; if !(self.cursor_pos.0 == self.new_cursor_pos.0 @@ -1783,7 +1783,7 @@ impl Component for CompactListing { self.sortcmd = true; if !self.filtered_selection.is_empty() { // FIXME: perform sort - self.dirty = true; + self.set_dirty(true); } else { self.refresh_mailbox(context, false); } @@ -1854,7 +1854,7 @@ impl Component for CompactListing { self.rows.row_update_add_thread(thread); } - self.dirty = true; + self.set_dirty(true); if self.unfocused() { self.view @@ -1884,7 +1884,7 @@ impl Component for CompactListing { self.rows.row_update_add_thread(thread); } - self.dirty = true; + self.set_dirty(true); if self.unfocused() { self.view @@ -1892,10 +1892,10 @@ impl Component for CompactListing { } } UIEvent::ChangeMode(UIMode::Normal) => { - self.dirty = true; + self.set_dirty(true); } UIEvent::Resize => { - self.dirty = true; + self.set_dirty(true); } UIEvent::Input(Key::Esc) if !self.unfocused() @@ -1909,7 +1909,7 @@ impl Component for CompactListing { for v in self.rows.selection.values_mut() { *v = false; } - self.dirty = true; + self.set_dirty(true); return true; } UIEvent::Input(Key::Esc) if !self.unfocused() && !self.filter_term.is_empty() => { diff --git a/src/components/mail/listing/conversations.rs b/src/components/mail/listing/conversations.rs index a014afaf..0c3618e8 100644 --- a/src/components/mail/listing/conversations.rs +++ b/src/components/mail/listing/conversations.rs @@ -168,7 +168,7 @@ impl MailListingTrait for ConversationsListing { } fn refresh_mailbox(&mut self, context: &mut Context, force: bool) { - self.dirty = true; + self.set_dirty(true); let old_mailbox_hash = self.cursor_pos.1; let old_cursor_pos = self.cursor_pos; if !(self.cursor_pos.0 == self.new_cursor_pos.0 @@ -1327,7 +1327,7 @@ impl Component for ConversationsListing { self.rows.rename_env(*old_hash, *new_hash); } - self.dirty = true; + self.set_dirty(true); if self.unfocused() { self.view.process_event( @@ -1359,7 +1359,7 @@ impl Component for ConversationsListing { self.rows.row_updates.push(*env_hash); } - self.dirty = true; + self.set_dirty(true); if self.unfocused() { self.view @@ -1392,7 +1392,7 @@ impl Component for ConversationsListing { self.sort, &context.accounts[&self.cursor_pos.0].collection.envelopes, ); - self.dirty = true; + self.set_dirty(true); } else { self.refresh_mailbox(context, false); } @@ -1441,10 +1441,10 @@ impl Component for ConversationsListing { self.set_dirty(true); } UIEvent::ChangeMode(UIMode::Normal) => { - self.dirty = true; + self.set_dirty(true); } UIEvent::Resize => { - self.dirty = true; + self.set_dirty(true); } UIEvent::Action(ref action) => match action { Action::Listing(Search(ref filter_term)) if !self.unfocused() => { @@ -1482,7 +1482,7 @@ impl Component for ConversationsListing { .any(std::convert::identity) => { self.rows.clear_selection(); - self.dirty = true; + self.set_dirty(true); return true; } UIEvent::Input(Key::Esc) | UIEvent::Input(Key::Char('')) diff --git a/src/components/mail/listing/plain.rs b/src/components/mail/listing/plain.rs index 44eef4f1..94e692d3 100644 --- a/src/components/mail/listing/plain.rs +++ b/src/components/mail/listing/plain.rs @@ -185,7 +185,7 @@ impl MailListingTrait for PlainListing { /// Fill the `self.data_columns` `CellBuffers` with the contents of the account mailbox the user has /// chosen. fn refresh_mailbox(&mut self, context: &mut Context, force: bool) { - self.dirty = true; + self.set_dirty(true); let old_cursor_pos = self.cursor_pos; if !(self.cursor_pos.0 == self.new_cursor_pos.0 && self.cursor_pos.1 == self.new_cursor_pos.1) @@ -1478,7 +1478,7 @@ impl Component for PlainListing { } } - self.dirty = true; + self.set_dirty(true); if self.unfocused() { self.view @@ -1497,7 +1497,7 @@ impl Component for PlainListing { } self.rows.row_updates.push(*env_hash); - self.dirty = true; + self.set_dirty(true); if self.unfocused() { self.view @@ -1505,10 +1505,10 @@ impl Component for PlainListing { } } UIEvent::ChangeMode(UIMode::Normal) => { - self.dirty = true; + self.set_dirty(true); } UIEvent::Resize => { - self.dirty = true; + self.set_dirty(true); } UIEvent::Input(Key::Esc) if !self.unfocused() @@ -1520,7 +1520,7 @@ impl Component for PlainListing { .any(std::convert::identity) => { self.rows.clear_selection(); - self.dirty = true; + self.set_dirty(true); return true; } UIEvent::Input(Key::Esc) if !self.unfocused() && !self.filter_term.is_empty() => { diff --git a/src/components/mail/listing/thread.rs b/src/components/mail/listing/thread.rs index 3d9eb8b0..765be9cf 100644 --- a/src/components/mail/listing/thread.rs +++ b/src/components/mail/listing/thread.rs @@ -170,7 +170,7 @@ impl MailListingTrait for ThreadListing { /// Fill the `self.content` `CellBuffer` with the contents of the account mailbox the user has /// chosen. fn refresh_mailbox(&mut self, context: &mut Context, _force: bool) { - self.dirty = true; + self.set_dirty(true); if !(self.cursor_pos.0 == self.new_cursor_pos.0 && self.cursor_pos.1 == self.new_cursor_pos.1) { @@ -1409,7 +1409,7 @@ impl Component for ThreadListing { (self.rows.entries[row].0).1 = *new_hash; } - self.dirty = true; + self.set_dirty(true); if self.unfocused() { if let Some(v) = self.view.as_mut() { @@ -1435,7 +1435,7 @@ impl Component for ThreadListing { self.rows.row_updates.push(*env_hash); } - self.dirty = true; + self.set_dirty(true); if self.unfocused() { if let Some(v) = self.view.as_mut() { @@ -1444,10 +1444,10 @@ impl Component for ThreadListing { } } UIEvent::ChangeMode(UIMode::Normal) => { - self.dirty = true; + self.set_dirty(true); } UIEvent::Resize => { - self.dirty = true; + self.set_dirty(true); } UIEvent::Input(Key::Esc) if !self.unfocused() @@ -1461,7 +1461,7 @@ impl Component for ThreadListing { for v in self.rows.selection.values_mut() { *v = false; } - self.dirty = true; + self.set_dirty(true); return true; } UIEvent::Input(ref key) @@ -1480,14 +1480,14 @@ impl Component for ThreadListing { Action::SubSort(field, order) => { debug!("SubSort {:?} , {:?}", field, order); self.subsort = (*field, *order); - self.dirty = true; + self.set_dirty(true); self.refresh_mailbox(context, false); return true; } Action::Sort(field, order) => { debug!("Sort {:?} , {:?}", field, order); self.sort = (*field, *order); - self.dirty = true; + self.set_dirty(true); self.refresh_mailbox(context, false); return true; } |