diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-12-02 20:47:48 +0200 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-12-02 21:01:22 +0200 |
commit | 48e7a493a92730bedccc5dfaac8242ed49d55a0d (patch) | |
tree | 0fea8098a1e5d5ced26efca389bb3e5f56157756 /src/components/mail/listing/compact.rs | |
parent | e5b0ff4fe2799339076de95227b13d9755245f5f (diff) |
Add reload-config command
Closes #84 Add "reload configuration" command
Diffstat (limited to 'src/components/mail/listing/compact.rs')
-rw-r--r-- | src/components/mail/listing/compact.rs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/components/mail/listing/compact.rs b/src/components/mail/listing/compact.rs index 882a7743..dbc4b940 100644 --- a/src/components/mail/listing/compact.rs +++ b/src/components/mail/listing/compact.rs @@ -1691,6 +1691,43 @@ impl Component for CompactListing { } } match *event { + UIEvent::ConfigReload { old_settings: _ } => { + self.color_cache = ColorCache { + even_unseen: crate::conf::value(context, "mail.listing.compact.even_unseen"), + even_selected: crate::conf::value( + context, + "mail.listing.compact.even_selected", + ), + even_highlighted: crate::conf::value( + context, + "mail.listing.compact.even_highlighted", + ), + odd_unseen: crate::conf::value(context, "mail.listing.compact.odd_unseen"), + odd_selected: crate::conf::value(context, "mail.listing.compact.odd_selected"), + odd_highlighted: crate::conf::value( + context, + "mail.listing.compact.odd_highlighted", + ), + even: crate::conf::value(context, "mail.listing.compact.even"), + odd: crate::conf::value(context, "mail.listing.compact.odd"), + attachment_flag: crate::conf::value(context, "mail.listing.attachment_flag"), + thread_snooze_flag: crate::conf::value( + context, + "mail.listing.thread_snooze_flag", + ), + 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.refresh_mailbox(context, true); + self.set_dirty(true); + } UIEvent::MailboxUpdate((ref idxa, ref idxf)) if (*idxa, *idxf) == (self.new_cursor_pos.0, self.cursor_pos.1) => { |