summaryrefslogtreecommitdiffstats
path: root/ui/src/components/mail/listing
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2019-04-04 14:24:05 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-06-10 19:40:42 +0300
commitee4462881e2a0c9fdbb12fe0e33067e3052ef04d (patch)
tree0227eb4e1a2183b504ddc02be51288946a60f495 /ui/src/components/mail/listing
parent1c7aa0ec9c8b3c80f7844a315fc002294b198aa5 (diff)
run cargo fmt
Diffstat (limited to 'ui/src/components/mail/listing')
-rw-r--r--ui/src/components/mail/listing/compact.rs18
-rw-r--r--ui/src/components/mail/listing/plain.rs11
-rw-r--r--ui/src/components/mail/listing/thread.rs17
3 files changed, 35 insertions, 11 deletions
diff --git a/ui/src/components/mail/listing/compact.rs b/ui/src/components/mail/listing/compact.rs
index 17ab9e54..a748c372 100644
--- a/ui/src/components/mail/listing/compact.rs
+++ b/ui/src/components/mail/listing/compact.rs
@@ -275,7 +275,8 @@ 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 || self.cursor_pos.0 != self.new_cursor_pos.0 {
+ 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);
@@ -484,11 +485,15 @@ impl Component for CompactListing {
UIEventType::RefreshMailbox(_) => {
self.dirty = true;
}
- UIEventType::MailboxUpdate((ref idxa, ref idxf)) if *idxa == self.new_cursor_pos.0 && *idxf == self.new_cursor_pos.1 => {
+ UIEventType::MailboxUpdate((ref idxa, ref idxf))
+ if *idxa == self.new_cursor_pos.0 && *idxf == self.new_cursor_pos.1 =>
+ {
self.refresh_mailbox(context);
self.set_dirty();
}
- UIEventType::StartupCheck(ref f) if context.mailbox_hashes[f] == (self.new_cursor_pos.0, self.new_cursor_pos.1) => {
+ UIEventType::StartupCheck(ref f)
+ if context.mailbox_hashes[f] == (self.new_cursor_pos.0, self.new_cursor_pos.1) =>
+ {
self.refresh_mailbox(context);
self.set_dirty();
}
@@ -534,7 +539,12 @@ impl Component for CompactListing {
false
}
fn is_dirty(&self) -> bool {
- self.dirty || if self.unfocused { self.view.is_dirty() } else { false }
+ self.dirty
+ || if self.unfocused {
+ self.view.is_dirty()
+ } else {
+ false
+ }
}
fn set_dirty(&mut self) {
if self.unfocused {
diff --git a/ui/src/components/mail/listing/plain.rs b/ui/src/components/mail/listing/plain.rs
index 16368f95..27801887 100644
--- a/ui/src/components/mail/listing/plain.rs
+++ b/ui/src/components/mail/listing/plain.rs
@@ -252,7 +252,8 @@ 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 || self.cursor_pos.0 != self.new_cursor_pos.0 {
+ 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);
@@ -502,11 +503,15 @@ impl Component for PlainListing {
self.dirty = true;
self.view = None;
}
- UIEventType::MailboxUpdate((ref idxa, ref idxf)) if *idxa == self.new_cursor_pos.0 && *idxf == self.new_cursor_pos.1 => {
+ UIEventType::MailboxUpdate((ref idxa, ref idxf))
+ if *idxa == self.new_cursor_pos.0 && *idxf == self.new_cursor_pos.1 =>
+ {
self.refresh_mailbox(context);
self.set_dirty();
}
- UIEventType::StartupCheck(ref f) if context.mailbox_hashes[f] == (self.new_cursor_pos.0, self.new_cursor_pos.1) => {
+ UIEventType::StartupCheck(ref f)
+ if context.mailbox_hashes[f] == (self.new_cursor_pos.0, self.new_cursor_pos.1) =>
+ {
self.refresh_mailbox(context);
self.set_dirty();
}
diff --git a/ui/src/components/mail/listing/thread.rs b/ui/src/components/mail/listing/thread.rs
index 029e5a1c..d1f55aba 100644
--- a/ui/src/components/mail/listing/thread.rs
+++ b/ui/src/components/mail/listing/thread.rs
@@ -48,7 +48,11 @@ pub struct ThreadListing {
impl ListingTrait for ThreadListing {
fn coordinates(&self) -> (usize, usize, Option<EnvelopeHash>) {
- (self.cursor_pos.0, self.cursor_pos.1, Some(self.locations[self.cursor_pos.2]))
+ (
+ self.cursor_pos.0,
+ self.cursor_pos.1,
+ Some(self.locations[self.cursor_pos.2]),
+ )
}
fn set_coordinates(&mut self, coordinates: (usize, usize, Option<EnvelopeHash>)) {
self.new_cursor_pos = (coordinates.0, coordinates.1, 0);
@@ -291,7 +295,8 @@ 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 || self.cursor_pos.0 != self.new_cursor_pos.0 {
+ 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);
@@ -660,11 +665,15 @@ impl Component for ThreadListing {
self.dirty = true;
self.view = None;
}
- UIEventType::MailboxUpdate((ref idxa, ref idxf)) if *idxa == self.new_cursor_pos.0 && *idxf == self.new_cursor_pos.1 => {
+ UIEventType::MailboxUpdate((ref idxa, ref idxf))
+ if *idxa == self.new_cursor_pos.0 && *idxf == self.new_cursor_pos.1 =>
+ {
self.refresh_mailbox(context);
self.set_dirty();
}
- UIEventType::StartupCheck(ref f) if context.mailbox_hashes[f] == (self.new_cursor_pos.0, self.new_cursor_pos.1) => {
+ UIEventType::StartupCheck(ref f)
+ if context.mailbox_hashes[f] == (self.new_cursor_pos.0, self.new_cursor_pos.1) =>
+ {
self.refresh_mailbox(context);
self.set_dirty();
}