diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-09 18:44:58 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-09 18:44:58 -0500 |
commit | 321549c05e47c322998edba05a52d16a722f17a7 (patch) | |
tree | f5a856c2fada9591f5b13645f4c9e001b3a15a62 /src/history.rs | |
parent | f1878e73c2892da9b929a11c2ee805d9b46f7e6b (diff) | |
download | nbsh-321549c05e47c322998edba05a52d16a722f17a7.tar.gz nbsh-321549c05e47c322998edba05a52d16a722f17a7.zip |
tweak colors a bit
Diffstat (limited to 'src/history.rs')
-rw-r--r-- | src/history.rs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/history.rs b/src/history.rs index 6c31b10..92851b9 100644 --- a/src/history.rs +++ b/src/history.rs @@ -185,7 +185,7 @@ impl HistoryEntry { scrolling: bool, offset: time::UtcOffset, ) { - out.set_bgcolor(textmode::Color::Rgb(32, 32, 32)); + self.set_bgcolor(out, focused); if let Some(info) = self.exit_info { if info.status.signal().is_some() { out.set_fgcolor(textmode::color::MAGENTA); @@ -199,21 +199,14 @@ impl HistoryEntry { out.write_str(" "); } out.reset_attributes(); - if focused { - out.set_fgcolor(textmode::color::BLACK); - out.set_bgcolor(textmode::color::CYAN); - } else { - out.set_bgcolor(textmode::Color::Rgb(32, 32, 32)); - } + self.set_bgcolor(out, focused); out.write_str("$ "); - out.reset_attributes(); - out.set_bgcolor(textmode::Color::Rgb(32, 32, 32)); if self.running() { out.set_bgcolor(textmode::Color::Rgb(16, 64, 16)); } out.write_str(&self.cmd); out.reset_attributes(); - out.set_bgcolor(textmode::Color::Rgb(32, 32, 32)); + self.set_bgcolor(out, focused); let time = if let Some(info) = self.exit_info { format!( "[{} ({:6})]", @@ -308,6 +301,14 @@ impl HistoryEntry { out.reset_attributes(); } + fn set_bgcolor(&self, out: &mut textmode::Output, focus: bool) { + if focus { + out.set_bgcolor(textmode::Color::Rgb(32, 32, 64)); + } else { + out.set_bgcolor(textmode::Color::Rgb(32, 32, 32)); + } + } + fn toggle_fullscreen(&mut self) { if let Some(fullscreen) = self.fullscreen { self.fullscreen = Some(!fullscreen); |