summaryrefslogtreecommitdiffstats
path: root/src/canvas/canvas_styling.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/canvas/canvas_styling.rs')
-rw-r--r--src/canvas/canvas_styling.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/canvas/canvas_styling.rs b/src/canvas/canvas_styling.rs
index e0de7285..ffb60cb2 100644
--- a/src/canvas/canvas_styling.rs
+++ b/src/canvas/canvas_styling.rs
@@ -18,6 +18,8 @@ pub struct CanvasColours {
pub currently_selected_text_style: Style,
pub table_header_style: Style,
pub ram_style: Style,
+ #[cfg(not(target_os = "windows"))]
+ pub cache_style: Style,
pub swap_style: Style,
pub arc_style: Style,
pub gpu_colour_styles: Vec<Style>,
@@ -54,6 +56,8 @@ impl Default for CanvasColours {
.bg(currently_selected_bg_colour),
table_header_style: Style::default().fg(HIGHLIGHT_COLOUR),
ram_style: Style::default().fg(FIRST_COLOUR),
+ #[cfg(not(target_os = "windows"))]
+ cache_style: Style::default().fg(FIFTH_COLOUR),
swap_style: Style::default().fg(SECOND_COLOUR),
arc_style: Style::default().fg(THIRD_COLOUR),
gpu_colour_styles: vec![
@@ -162,6 +166,12 @@ impl CanvasColours {
.context("Update 'ram_color' in your config file..")?;
}
+ #[cfg(not(target_os = "windows"))]
+ if let Some(cache_color) = &colours.cache_color {
+ self.set_cache_colour(cache_color)
+ .context("Update 'cache_color' in your config file..")?;
+ }
+
if let Some(swap_color) = &colours.swap_color {
self.set_swap_colour(swap_color)
.context("Update 'swap_color' in your config file..")?;
@@ -275,6 +285,12 @@ impl CanvasColours {
Ok(())
}
+ #[cfg(not(target_os = "windows"))]
+ pub fn set_cache_colour(&mut self, colour: &str) -> error::Result<()> {
+ self.cache_style = str_to_fg(colour)?;
+ Ok(())
+ }
+
pub fn set_swap_colour(&mut self, colour: &str) -> error::Result<()> {
self.swap_style = str_to_fg(colour)?;
Ok(())