ui: properly update cursor on refresh_mailbox in PlainListing

embed
Manos Pitsidianakis 2019-04-03 16:57:26 +03:00
parent c4bec2ed6a
commit dcb62798f8
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
3 changed files with 5 additions and 3 deletions

View File

@ -259,7 +259,7 @@ impl CompactListing {
/// Draw the list of `Envelope`s.
fn draw_list(&mut self, grid: &mut CellBuffer, area: Area, context: &mut Context) {
if self.cursor_pos.1 != self.new_cursor_pos.1 {
if self.cursor_pos.1 != self.new_cursor_pos.1 || self.cursor_pos.0 != self.new_cursor_pos.0 {
self.refresh_mailbox(context);
}
let upper_left = upper_left!(area);

View File

@ -92,6 +92,8 @@ impl PlainListing {
self.cursor_pos.2 = 0;
self.new_cursor_pos.2 = 0;
}
self.cursor_pos.0 = self.new_cursor_pos.0;
self.cursor_pos.1 = self.new_cursor_pos.1;
// Inform State that we changed the current folder view.
context.replies.push_back(UIEvent {
@ -252,7 +254,7 @@ impl PlainListing {
/// Draw the list of `Envelope`s.
fn draw_list(&mut self, grid: &mut CellBuffer, area: Area, context: &mut Context) {
if self.cursor_pos.1 != self.new_cursor_pos.1 {
if self.cursor_pos.1 != self.new_cursor_pos.1 || self.cursor_pos.0 != self.new_cursor_pos.0 {
self.refresh_mailbox(context);
}
let upper_left = upper_left!(area);

View File

@ -282,7 +282,7 @@ impl ThreadListing {
/// Draw the list of `Envelope`s.
fn draw_list(&mut self, grid: &mut CellBuffer, area: Area, context: &mut Context) {
if self.cursor_pos.1 != self.new_cursor_pos.1 {
if self.cursor_pos.1 != self.new_cursor_pos.1 || self.cursor_pos.0 != self.new_cursor_pos.0 {
self.refresh_mailbox(context);
}
let upper_left = upper_left!(area);