diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-01-23 19:52:54 +0200 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-01-23 19:52:54 +0200 |
commit | 1e2b3c073d8b6ba3634774c54ddcfd4d612c8acb (patch) | |
tree | 8b95ac15d1cecc5ded1861f49e4edee0a910d0fa /ui/src/components/mail/listing.rs | |
parent | f787eb75b63858bbc495dd7df1938f7ad52f2699 (diff) |
ui/themes: add ThemeAttribute
Consolidate {fg,bg} color theme settings to ThemeAttribute and add Attr
(bold, etc).
Diffstat (limited to 'ui/src/components/mail/listing.rs')
-rw-r--r-- | ui/src/components/mail/listing.rs | 80 |
1 files changed, 37 insertions, 43 deletions
diff --git a/ui/src/components/mail/listing.rs b/ui/src/components/mail/listing.rs index e317fcab..24446e5d 100644 --- a/ui/src/components/mail/listing.rs +++ b/ui/src/components/mail/listing.rs @@ -46,29 +46,21 @@ pub struct DataColumns { #[derive(Debug, Default)] /// Save theme colors to avoid looking them up again and again from settings struct ColorCache { - unseen_fg: Color, - unseen_bg: Color, - highlighted_fg: Color, - highlighted_bg: Color, - even_fg: Color, - even_bg: Color, - odd_fg: Color, - odd_bg: Color, - selected_bg: Color, - attachment_flag_fg: Color, - thread_snooze_flag_fg: Color, + unseen: ThemeAttribute, + highlighted: ThemeAttribute, + even: ThemeAttribute, + odd: ThemeAttribute, + selected: ThemeAttribute, + attachment_flag: ThemeAttribute, + thread_snooze_flag: ThemeAttribute, /* Conversations */ - fg: Color, - bg: Color, - subject_fg: Color, - subject_bg: Color, - from_fg: Color, - from_bg: Color, - date_fg: Color, - date_bg: Color, - padding: Color, - unseen_padding: Color, + general: ThemeAttribute, + subject: ThemeAttribute, + from: ThemeAttribute, + date: ThemeAttribute, + padding: ThemeAttribute, + unseen_padding: ThemeAttribute, } #[derive(Debug)] @@ -1067,37 +1059,39 @@ impl Listing { ) = if must_highlight_account { if self.cursor_pos.1 == idx { ( - crate::conf::color(context, "mail.sidebar_highlighted_fg"), - crate::conf::color(context, "mail.sidebar_highlighted_bg"), - crate::conf::color(context, "mail.sidebar_highlighted_index_fg"), - crate::conf::color(context, "mail.sidebar_highlighted_index_bg"), - crate::conf::color(context, "mail.sidebar_highlighted_unread_count_fg"), - crate::conf::color(context, "mail.sidebar_highlighted_unread_count_bg"), + crate::conf::value(context, "mail.sidebar_highlighted").fg, + crate::conf::value(context, "mail.sidebar_highlighted").bg, + crate::conf::value(context, "mail.sidebar_highlighted_index").fg, + crate::conf::value(context, "mail.sidebar_highlighted_index").bg, + crate::conf::value(context, "mail.sidebar_highlighted_unread_count").fg, + crate::conf::value(context, "mail.sidebar_highlighted_unread_count").bg, ) } else { ( - crate::conf::color(context, "mail.sidebar_highlighted_account_fg"), - crate::conf::color(context, "mail.sidebar_highlighted_account_bg"), - crate::conf::color(context, "mail.sidebar_highlighted_account_index_fg"), - crate::conf::color(context, "mail.sidebar_highlighted_account_index_bg"), - crate::conf::color( + crate::conf::value(context, "mail.sidebar_highlighted_account").fg, + crate::conf::value(context, "mail.sidebar_highlighted_account").bg, + crate::conf::value(context, "mail.sidebar_highlighted_account_index").fg, + crate::conf::value(context, "mail.sidebar_highlighted_account_index").bg, + crate::conf::value( context, - "mail.sidebar_highlighted_account_unread_count_fg", - ), - crate::conf::color( + "mail.sidebar_highlighted_account_unread_count", + ) + .fg, + crate::conf::value( context, - "mail.sidebar_highlighted_account_unread_count_bg", - ), + "mail.sidebar_highlighted_account_unread_count", + ) + .bg, ) } } else { ( - crate::conf::color(context, "mail.sidebar_fg"), - crate::conf::color(context, "mail.sidebar_bg"), - crate::conf::color(context, "mail.sidebar_index_fg"), - crate::conf::color(context, "mail.sidebar_index_bg"), - crate::conf::color(context, "mail.sidebar_unread_count_fg"), - crate::conf::color(context, "mail.sidebar_unread_count_bg"), + crate::conf::value(context, "mail.sidebar").fg, + crate::conf::value(context, "mail.sidebar").bg, + crate::conf::value(context, "mail.sidebar_index").fg, + crate::conf::value(context, "mail.sidebar_index").bg, + crate::conf::value(context, "mail.sidebar_unread_count").fg, + crate::conf::value(context, "mail.sidebar_unread_count").bg, ) }; |