diff --git a/src/components/mail/view/thread.rs b/src/components/mail/view/thread.rs index 4ce6877e..87ad7ce5 100644 --- a/src/components/mail/view/thread.rs +++ b/src/components/mail/view/thread.rs @@ -23,15 +23,6 @@ use super::*; use crate::components::utilities::PageMovement; use std::cmp; -const INDENTATION_COLORS: &'static [u8] = &[ - 69, // CornflowerBlue - 196, // Red1 - 175, // Pink3 - 220, // Gold1 - 172, // Orange3 - 072, // CadetBlue -]; - #[derive(Debug, Clone)] struct ThreadEntry { index: (usize, ThreadNodeHash, usize), @@ -58,6 +49,7 @@ pub struct ThreadView { show_thread: bool, entries: Vec, visible_entries: Vec>, + indentation_colors: [ThemeAttribute; 6], movement: Option, dirty: bool, @@ -91,6 +83,14 @@ impl ThreadView { new_cursor_pos: 0, dirty: true, id: ComponentId::new_v4(), + indentation_colors: [ + crate::conf::value(context, "mail.view.thread.indentation.a"), + crate::conf::value(context, "mail.view.thread.indentation.b"), + crate::conf::value(context, "mail.view.thread.indentation.c"), + crate::conf::value(context, "mail.view.thread.indentation.d"), + crate::conf::value(context, "mail.view.thread.indentation.e"), + crate::conf::value(context, "mail.view.thread.indentation.f"), + ], ..Default::default() }; view.initiate(expanded_hash, context); @@ -306,12 +306,13 @@ impl ThreadView { /* Box character drawing stuff */ let mut x = 0; for i in 0..e.index.0 { - let color = INDENTATION_COLORS[(i).wrapping_rem(INDENTATION_COLORS.len())]; + let att = + self.indentation_colors[(i).wrapping_rem(self.indentation_colors.len())]; change_colors( &mut content, ((x, 2 * y), (x + 3, 2 * y + 1)), - Color::Default, - Color::Byte(color), + att.fg, + att.bg, ); x += 4; } diff --git a/src/conf/themes.rs b/src/conf/themes.rs index ecd6eff7..fdb93d69 100644 --- a/src/conf/themes.rs +++ b/src/conf/themes.rs @@ -199,6 +199,12 @@ const DEFAULT_KEYS: &'static [&'static str] = &[ "mail.listing.conversations.selected", "mail.view.headers", "mail.view.body", + "mail.view.thread.indentation.a", + "mail.view.thread.indentation.b", + "mail.view.thread.indentation.c", + "mail.view.thread.indentation.d", + "mail.view.thread.indentation.e", + "mail.view.thread.indentation.f", "mail.listing.attachment_flag", "mail.listing.thread_snooze_flag", "mail.listing.tag_default", @@ -857,6 +863,12 @@ impl Default for Theme { } ); add!("mail.view.body"); + add!("mail.view.thread.indentation.a", light = { bg: Color::Byte(69) }, dark = { bg: Color::Byte(69) }); // CornflowerBlue + add!("mail.view.thread.indentation.b", light = { bg: Color::Byte(196) }, dark = { bg: Color::Byte(196) }); // Red1 + add!("mail.view.thread.indentation.c", light = { bg: Color::Byte(175) }, dark = { bg: Color::Byte(175) }); // Pink3 + add!("mail.view.thread.indentation.d", light = { bg: Color::Byte(220) }, dark = { bg: Color::Byte(220) }); // Gold1 + add!("mail.view.thread.indentation.e", light = { bg: Color::Byte(172) }, dark = { bg: Color::Byte(172) }); // Orange3 + add!("mail.view.thread.indentation.f", light = { bg: Color::Byte(072) }, dark = { bg: Color::Byte(072) }); // CadetBlue add!( "mail.listing.attachment_flag",