diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-10-06 10:58:47 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-10-06 11:31:53 +0300 |
commit | b25f10f92a299309a8319c22c3ca0c7da8b6689f (patch) | |
tree | 5dd77a5193ee1ed47a22c9b7f52628648b545881 /ui/src/components/mail/listing/compact.rs | |
parent | a0602274f8417bfeb22784c8e31a889bf50caa93 (diff) |
conf: add a light theme option
Diffstat (limited to 'ui/src/components/mail/listing/compact.rs')
-rw-r--r-- | ui/src/components/mail/listing/compact.rs | 46 |
1 files changed, 34 insertions, 12 deletions
diff --git a/ui/src/components/mail/listing/compact.rs b/ui/src/components/mail/listing/compact.rs index 7afd9db9..e486009d 100644 --- a/ui/src/components/mail/listing/compact.rs +++ b/ui/src/components/mail/listing/compact.rs @@ -93,14 +93,26 @@ impl ListingTrait for CompactListing { let thread_node = &threads.thread_nodes[&i]; let fg_color = self.data_columns.columns[0][(0, idx)].fg(); - let bg_color = if self.cursor_pos.2 == idx { - Color::Byte(246) - } else if self.selection[&i] { - Color::Byte(210) - } else if thread_node.has_unseen() { - Color::Byte(251) + let bg_color = if context.settings.terminal.theme == "light" { + if self.cursor_pos.2 == idx { + Color::Byte(244) + } else if self.selection[&i] { + Color::Byte(210) + } else if thread_node.has_unseen() { + Color::Byte(251) + } else { + self.data_columns.columns[0][(0, idx)].bg() + } } else { - self.data_columns.columns[0][(0, idx)].bg() + if self.cursor_pos.2 == idx { + Color::Byte(246) + } else if self.selection[&i] { + Color::Byte(210) + } else if thread_node.has_unseen() { + Color::Byte(251) + } else { + self.data_columns.columns[0][(0, idx)].bg() + } }; let (upper_left, bottom_right) = area; @@ -639,12 +651,22 @@ impl CompactListing { } else { Color::Default }; - let bg_color = if thread_node.has_unseen() { - Color::Byte(251) - } else if idx % 2 == 0 { - Color::Byte(236) + let bg_color = if context.settings.terminal.theme == "light" { + if thread_node.has_unseen() { + Color::Byte(251) + } else if idx % 2 == 0 { + Color::Byte(252) + } else { + Color::Default + } } else { - Color::Default + if thread_node.has_unseen() { + Color::Byte(253) + } else if idx % 2 == 0 { + Color::Byte(236) + } else { + Color::Default + } }; let (x, _) = write_string_to_grid( &idx.to_string(), |