Skip to content

Commit

Permalink
change: make table headers bold by default (#1513)
Browse files Browse the repository at this point in the history
* change: make table headers bold by default

* changelog
  • Loading branch information
ClementTsang authored Jul 31, 2024
1 parent 08a7b8b commit c77256e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#1499](https://github.com/ClementTsang/bottom/pull/1499): Redesign how styling is configured.
- [#1499](https://github.com/ClementTsang/bottom/pull/1499): The following arguments have changed names:
- `--colors` is now `--theme`
- [#1513](https://github.com/ClementTsang/bottom/pull/1513): Table headers are now bold by default.

### Bug Fixes

Expand Down
4 changes: 2 additions & 2 deletions sample_configs/default_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
# - "nord-light".
#
# This will have the lowest precedence if a custom colour palette is set,
# or overriden if the command-line flag for a built-in theme is set.
# or overridden if the command-line flag for a built-in theme is set.
#theme = "default"

#[styles.cpu]
Expand All @@ -165,7 +165,7 @@
#low_battery_color = "red"

#[styles.tables]
#headers = {color = "light blue"}
#headers = {color = "light blue", bold = true}

#[styles.graphs]
#graph_color = "gray"
Expand Down
4 changes: 2 additions & 2 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ pub const CONFIG_TEXT: &str = r#"# This is a default config file for bottom. Al
# - "nord-light".
#
# This will have the lowest precedence if a custom colour palette is set,
# or overriden if the command-line flag for a built-in theme is set.
# or overridden if the command-line flag for a built-in theme is set.
#theme = "default"
#[styles.cpu]
Expand All @@ -429,7 +429,7 @@ pub const CONFIG_TEXT: &str = r#"# This is a default config file for bottom. Al
#low_battery_color = "red"
#[styles.tables]
#headers = {color = "light blue"}
#headers = {color = "light blue", bold = true}
#[styles.graphs]
#graph_color = "gray"
Expand Down
6 changes: 3 additions & 3 deletions src/options/config/style/themes/default.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use tui::style::{Color, Style};
use tui::style::{Color, Modifier, Style};

use crate::options::config::style::ColourPalette;

Expand All @@ -22,7 +22,7 @@ impl ColourPalette {

Self {
selected_text_style: DEFAULT_SELECTED_TEXT_STYLE,
table_header_style: color!(HIGHLIGHT_COLOUR),
table_header_style: color!(HIGHLIGHT_COLOUR).add_modifier(Modifier::BOLD),
ram_style: color!(FIRST_COLOUR),
#[cfg(not(target_os = "windows"))]
cache_style: color!(FIFTH_COLOUR),
Expand Down Expand Up @@ -70,7 +70,7 @@ impl ColourPalette {
pub fn default_light_mode() -> Self {
Self {
selected_text_style: color!(Color::White),
table_header_style: color!(Color::Black),
table_header_style: color!(Color::Black).add_modifier(Modifier::BOLD),
ram_style: color!(Color::Blue),
#[cfg(not(target_os = "windows"))]
cache_style: color!(Color::LightRed),
Expand Down
6 changes: 3 additions & 3 deletions src/options/config/style/themes/gruvbox.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use tui::style::Color;
use tui::style::{Color, Modifier};

use crate::options::config::style::{utils::convert_hex_to_color, ColourPalette};

Expand All @@ -8,7 +8,7 @@ impl ColourPalette {
pub(crate) fn gruvbox_palette() -> Self {
Self {
selected_text_style: hex!("#1d2021").bg(convert_hex_to_color("#ebdbb2").unwrap()),
table_header_style: hex!("#83a598"),
table_header_style: hex!("#83a598").add_modifier(Modifier::BOLD),
ram_style: hex!("#8ec07c"),
#[cfg(not(target_os = "windows"))]
cache_style: hex!("#b16286"),
Expand Down Expand Up @@ -68,7 +68,7 @@ impl ColourPalette {
pub(crate) fn gruvbox_light_palette() -> Self {
Self {
selected_text_style: hex!("#ebdbb2").bg(convert_hex_to_color("#3c3836").unwrap()),
table_header_style: hex!("#076678"),
table_header_style: hex!("#076678").add_modifier(Modifier::BOLD),
ram_style: hex!("#427b58"),
#[cfg(not(target_os = "windows"))]
cache_style: hex!("#d79921"),
Expand Down
6 changes: 3 additions & 3 deletions src/options/config/style/themes/nord.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use tui::style::Color;
use tui::style::{Color, Modifier};

use crate::options::config::style::{utils::convert_hex_to_color, ColourPalette};

Expand All @@ -8,7 +8,7 @@ impl ColourPalette {
pub(crate) fn nord_palette() -> Self {
Self {
selected_text_style: hex!("#2e3440").bg(convert_hex_to_color("#88c0d0").unwrap()),
table_header_style: hex!("#81a1c1"),
table_header_style: hex!("#81a1c1").add_modifier(Modifier::BOLD),
ram_style: hex!("#88c0d0"),
#[cfg(not(target_os = "windows"))]
cache_style: hex!("#d8dee9"),
Expand Down Expand Up @@ -56,7 +56,7 @@ impl ColourPalette {
pub(crate) fn nord_light_palette() -> Self {
Self {
selected_text_style: hex!("#f5f5f5").bg(convert_hex_to_color("#5e81ac").unwrap()),
table_header_style: hex!("#5e81ac"),
table_header_style: hex!("#5e81ac").add_modifier(Modifier::BOLD),
ram_style: hex!("#81a1c1"),
#[cfg(not(target_os = "windows"))]
cache_style: hex!("#4c566a"),
Expand Down

0 comments on commit c77256e

Please sign in to comment.