From 8764b3092adc6d622aa3df42b5fb9ff23a7b0f0f Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Sat, 8 Feb 2020 16:39:50 -0500 Subject: [PATCH] Some cleaning up of the canvas colour setting feature --- Cargo.toml | 2 +- sample_config.toml | 4 +- src/canvas.rs | 152 ++++++++++++++++++++++----------------------- 3 files changed, 77 insertions(+), 81 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1a9bccbc..b88b312c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bottom" -version = "0.1.2" +version = "0.2.0" authors = ["Clement Tsang "] edition = "2018" repository = "https://github.com/ClementTsang/bottom" diff --git a/sample_config.toml b/sample_config.toml index 2e8448f9..9ec74ded 100644 --- a/sample_config.toml +++ b/sample_config.toml @@ -13,7 +13,7 @@ regex = true [colors] # Based on gruvbox: https://github.com/morhetz/gruvbox table_header_color="#458588" -widget_title_color="#076678" +widget_title_color="#9d0006" cpu_core_colors=["#cc241d", "#98971a", "#d79921", "#458588", "#b16286", "#689d6a", "#fb4934", "#b8bb26", "#fabd2f", "#83a598"] ram_color="#fb4934" swap_color="#fabd2f" @@ -22,6 +22,6 @@ tx_color="#689d6a" border_color="#ebdbb2" highlighted_border_color="#fe8019" text_color="#ebdbb2" -graph_color="#076678" +graph_color="#9d0006" selected_text_color="#282828" selected_bg_color="#458588" \ No newline at end of file diff --git a/src/canvas.rs b/src/canvas.rs index f87e4d1e..9eaa29f9 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -188,15 +188,14 @@ pub struct Painter { } pub struct CanvasColours { - text_colour: Color, - scroll_text_colour: Color, - scroll_bg_colour: Color, + currently_selected_text_colour: Color, + currently_selected_bg_colour: Color, currently_selected_text_style: Style, table_header_style: Style, - ram_colour: Color, - swap_colour: Color, - rx_colour: Color, - tx_colour: Color, + ram_style: Style, + swap_style: Style, + rx_style: Style, + tx_style: Style, cpu_colour_styles: Vec