ui: force redraw CompactListing after EnvelopeRename event

embed
Manos Pitsidianakis 2019-07-06 00:15:32 +03:00
parent 6906142278
commit b5ba9c3a8c
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
2 changed files with 13 additions and 5 deletions

View File

@ -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 */
}

View File

@ -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