summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2019-07-06 00:15:32 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-07-06 00:19:37 +0300
commitb5ba9c3a8ca8f7a868adaac7e778a002f200bb4f (patch)
tree8159db748b36ee552e443e68eb93e0519e05c439
parent6906142278c69a250811d2691dbe96d5fa39732e (diff)
ui: force redraw CompactListing after EnvelopeRename event
-rw-r--r--ui/src/components/mail/listing/compact.rs12
-rw-r--r--ui/src/components/utilities.rs6
2 files changed, 13 insertions, 5 deletions
diff --git a/ui/src/components/mail/listing/compact.rs b/ui/src/components/mail/listing/compact.rs
index 785ad833..6514ca51 100644
--- a/ui/src/components/mail/listing/compact.rs
+++ b/ui/src/components/mail/listing/compact.rs
@@ -89,6 +89,7 @@ pub struct CompactListing {
selection: FnvHashMap<EnvelopeHash, bool>,
/// If we must redraw on next redraw event
dirty: bool,
+ force_draw: bool,
/// If `self.view` exists or not.
unfocused: bool,
view: ThreadView,
@@ -463,6 +464,7 @@ impl CompactListing {
row_updates: StackVec::new(),
data_columns: DataColumns::default(),
dirty: true,
+ force_draw: true,
unfocused: false,
view: ThreadView::default(),
@@ -982,6 +984,11 @@ impl Component for CompactListing {
);
}
}
+ if self.force_draw {
+ /* Draw the entire list */
+ self.draw_list(grid, area, context);
+ self.force_draw = false;
+ }
} else {
/* Draw the entire list */
self.draw_list(grid, area, context);
@@ -1066,6 +1073,10 @@ impl Component for CompactListing {
UIEvent::Input(ref k) if self.unfocused && *k == shortcuts["exit_thread"] => {
self.unfocused = false;
self.dirty = true;
+ /* If self.row_updates is not empty and we exit a thread, the row_update events
+ * will be performed but the list will not be drawn. So force a draw in any case.
+ * */
+ self.force_draw = true;
return true;
}
UIEvent::Input(ref key) if !self.unfocused && *key == shortcuts["select_entry"] => {
@@ -1109,7 +1120,6 @@ impl Component for CompactListing {
}
self.row_updates.push(*new_hash);
- self.dirty = true;
} else {
/* Listing has was updated in time before the event */
}
diff --git a/ui/src/components/utilities.rs b/ui/src/components/utilities.rs
index 72cbed84..ce56a4a6 100644
--- a/ui/src/components/utilities.rs
+++ b/ui/src/components/utilities.rs
@@ -523,11 +523,9 @@ impl Component for Pager {
self.max_cursor_pos = None;
return false;
}
- _ => {
- return false;
- }
+ _ => {}
}
- true
+ false
}
fn is_dirty(&self) -> bool {
self.dirty