From 7dfa6c0639e45ba7c9b2aa0976c34e1ad4e89a7d Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Fri, 18 Sep 2020 21:28:20 +0300 Subject: [PATCH] view/thread: use reverse colors in cursor in case of NO_COLOR --- src/components/mail/view/thread.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/mail/view/thread.rs b/src/components/mail/view/thread.rs index 14fb040da..aee289ef2 100644 --- a/src/components/mail/view/thread.rs +++ b/src/components/mail/view/thread.rs @@ -50,6 +50,7 @@ pub struct ThreadView { entries: Vec, visible_entries: Vec>, indentation_colors: [ThemeAttribute; 6], + use_color: bool, movement: Option, dirty: bool, @@ -91,6 +92,7 @@ impl ThreadView { crate::conf::value(context, "mail.view.thread.indentation.e"), crate::conf::value(context, "mail.view.thread.indentation.f"), ], + use_color: context.settings.terminal.use_color(), ..Default::default() }; view.initiate(expanded_hash, context); @@ -420,6 +422,16 @@ impl ThreadView { if idx == *visibles[self.cursor_pos] { let fg_color = Color::Default; let bg_color = Color::Byte(246); + let attrs = if self.use_color { + Attr::DEFAULT + } else { + Attr::REVERSE + }; + for row in grid.bounds_iter(dest_area) { + for c in row { + grid[c].set_fg(fg_color).set_bg(bg_color).set_attrs(attrs); + } + } change_colors(grid, dest_area, fg_color, bg_color); return; }