summaryrefslogtreecommitdiff
path: root/src/components/mail/listing/plain.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/mail/listing/plain.rs')
-rw-r--r--src/components/mail/listing/plain.rs46
1 files changed, 2 insertions, 44 deletions
diff --git a/src/components/mail/listing/plain.rs b/src/components/mail/listing/plain.rs
index 01a0ff48..83fe3d91 100644
--- a/src/components/mail/listing/plain.rs
+++ b/src/components/mail/listing/plain.rs
@@ -196,25 +196,7 @@ impl MailListingTrait for PlainListing {
self.cursor_pos.1 = self.new_cursor_pos.1;
self.cursor_pos.0 = self.new_cursor_pos.0;
- self.color_cache = ColorCache {
- even: crate::conf::value(context, "mail.listing.plain.even"),
- odd: crate::conf::value(context, "mail.listing.plain.odd"),
- even_unseen: crate::conf::value(context, "mail.listing.plain.even_unseen"),
- odd_unseen: crate::conf::value(context, "mail.listing.plain.odd_unseen"),
- even_highlighted: crate::conf::value(context, "mail.listing.plain.even_highlighted"),
- odd_highlighted: crate::conf::value(context, "mail.listing.plain.odd_highlighted"),
- even_selected: crate::conf::value(context, "mail.listing.plain.even_selected"),
- odd_selected: crate::conf::value(context, "mail.listing.plain.odd_selected"),
- tag_default: crate::conf::value(context, "mail.listing.tag_default"),
- theme_default: crate::conf::value(context, "theme_default"),
- ..self.color_cache
- };
- if !context.settings.terminal.use_color() {
- self.color_cache.highlighted.attrs |= Attr::REVERSE;
- self.color_cache.tag_default.attrs |= Attr::REVERSE;
- self.color_cache.even_highlighted.attrs |= Attr::REVERSE;
- self.color_cache.odd_highlighted.attrs |= Attr::REVERSE;
- }
+ self.color_cache = ColorCache::new(context, IndexStyle::Plain);
// Get mailbox as a reference.
//
@@ -1337,31 +1319,7 @@ impl Component for PlainListing {
}
match *event {
UIEvent::ConfigReload { old_settings: _ } => {
- self.color_cache = ColorCache {
- even: crate::conf::value(context, "mail.listing.plain.even"),
- odd: crate::conf::value(context, "mail.listing.plain.odd"),
- even_unseen: crate::conf::value(context, "mail.listing.plain.even_unseen"),
- odd_unseen: crate::conf::value(context, "mail.listing.plain.odd_unseen"),
- even_highlighted: crate::conf::value(
- context,
- "mail.listing.plain.even_highlighted",
- ),
- odd_highlighted: crate::conf::value(
- context,
- "mail.listing.plain.odd_highlighted",
- ),
- even_selected: crate::conf::value(context, "mail.listing.plain.even_selected"),
- odd_selected: crate::conf::value(context, "mail.listing.plain.odd_selected"),
- tag_default: crate::conf::value(context, "mail.listing.tag_default"),
- theme_default: crate::conf::value(context, "theme_default"),
- ..self.color_cache
- };
- if !context.settings.terminal.use_color() {
- self.color_cache.highlighted.attrs |= Attr::REVERSE;
- self.color_cache.tag_default.attrs |= Attr::REVERSE;
- self.color_cache.even_highlighted.attrs |= Attr::REVERSE;
- self.color_cache.odd_highlighted.attrs |= Attr::REVERSE;
- }
+ self.color_cache = ColorCache::new(context, IndexStyle::Plain);
self.refresh_mailbox(context, true);
self.set_dirty(true);