diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-04-03 16:57:26 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-06-10 19:40:42 +0300 |
commit | dcb62798f83d804b8165544971dd341346863177 (patch) | |
tree | 3d7d8499550a3b2651296ffcbf908ebaccaf7518 | |
parent | c4bec2ed6a04f595a5f9e34a826c560001445a58 (diff) |
ui: properly update cursor on refresh_mailbox in PlainListing
-rw-r--r-- | ui/src/components/mail/listing/compact.rs | 2 | ||||
-rw-r--r-- | ui/src/components/mail/listing/plain.rs | 4 | ||||
-rw-r--r-- | ui/src/components/mail/listing/thread.rs | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/ui/src/components/mail/listing/compact.rs b/ui/src/components/mail/listing/compact.rs index bf34350f..66854208 100644 --- a/ui/src/components/mail/listing/compact.rs +++ b/ui/src/components/mail/listing/compact.rs @@ -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); diff --git a/ui/src/components/mail/listing/plain.rs b/ui/src/components/mail/listing/plain.rs index ec3e23cb..807494a0 100644 --- a/ui/src/components/mail/listing/plain.rs +++ b/ui/src/components/mail/listing/plain.rs @@ -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); diff --git a/ui/src/components/mail/listing/thread.rs b/ui/src/components/mail/listing/thread.rs index 4c909ae2..5bd7c47d 100644 --- a/ui/src/components/mail/listing/thread.rs +++ b/ui/src/components/mail/listing/thread.rs @@ -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); |