ui: force redraw CompactListing after EnvelopeRename event
parent
6906142278
commit
b5ba9c3a8c
|
@ -89,6 +89,7 @@ pub struct CompactListing {
|
||||||
selection: FnvHashMap<EnvelopeHash, bool>,
|
selection: FnvHashMap<EnvelopeHash, bool>,
|
||||||
/// If we must redraw on next redraw event
|
/// If we must redraw on next redraw event
|
||||||
dirty: bool,
|
dirty: bool,
|
||||||
|
force_draw: bool,
|
||||||
/// If `self.view` exists or not.
|
/// If `self.view` exists or not.
|
||||||
unfocused: bool,
|
unfocused: bool,
|
||||||
view: ThreadView,
|
view: ThreadView,
|
||||||
|
@ -463,6 +464,7 @@ impl CompactListing {
|
||||||
row_updates: StackVec::new(),
|
row_updates: StackVec::new(),
|
||||||
data_columns: DataColumns::default(),
|
data_columns: DataColumns::default(),
|
||||||
dirty: true,
|
dirty: true,
|
||||||
|
force_draw: true,
|
||||||
unfocused: false,
|
unfocused: false,
|
||||||
view: ThreadView::default(),
|
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 {
|
} else {
|
||||||
/* Draw the entire list */
|
/* Draw the entire list */
|
||||||
self.draw_list(grid, area, context);
|
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"] => {
|
UIEvent::Input(ref k) if self.unfocused && *k == shortcuts["exit_thread"] => {
|
||||||
self.unfocused = false;
|
self.unfocused = false;
|
||||||
self.dirty = true;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
UIEvent::Input(ref key) if !self.unfocused && *key == shortcuts["select_entry"] => {
|
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.row_updates.push(*new_hash);
|
||||||
self.dirty = true;
|
|
||||||
} else {
|
} else {
|
||||||
/* Listing has was updated in time before the event */
|
/* Listing has was updated in time before the event */
|
||||||
}
|
}
|
||||||
|
|
|
@ -523,11 +523,9 @@ impl Component for Pager {
|
||||||
self.max_cursor_pos = None;
|
self.max_cursor_pos = None;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
true
|
false
|
||||||
}
|
}
|
||||||
fn is_dirty(&self) -> bool {
|
fn is_dirty(&self) -> bool {
|
||||||
self.dirty
|
self.dirty
|
||||||
|
|
Loading…
Reference in New Issue