-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: support custom widget borders (#1642)
* run a dep bump * add widget border type * feature: support custom widget borders * fmt * remove none since it looks really bad * fix bug with title for tables with no title when expanded * fix jsonschema * fix some unused stuff
- Loading branch information
1 parent
1fe17dd
commit 0d182e4
Showing
32 changed files
with
498 additions
and
495 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
pub mod data_table; | ||
pub mod time_graph; | ||
mod tui_widget; | ||
|
||
pub mod widget_carousel; | ||
|
||
pub use tui_widget::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
use tui::style::Style; | ||
use tui::{style::Style, widgets::BorderType}; | ||
|
||
use crate::options::config::style::ColourPalette; | ||
use crate::options::config::style::Styles; | ||
|
||
#[derive(Default)] | ||
pub struct DataTableStyling { | ||
pub header_style: Style, | ||
pub border_style: Style, | ||
pub border_type: BorderType, | ||
pub highlighted_border_style: Style, | ||
pub text_style: Style, | ||
pub highlighted_text_style: Style, | ||
pub title_style: Style, | ||
} | ||
|
||
impl DataTableStyling { | ||
pub fn from_palette(colours: &ColourPalette) -> Self { | ||
pub fn from_palette(styles: &Styles) -> Self { | ||
Self { | ||
header_style: colours.table_header_style, | ||
border_style: colours.border_style, | ||
highlighted_border_style: colours.highlighted_border_style, | ||
text_style: colours.text_style, | ||
highlighted_text_style: colours.selected_text_style, | ||
title_style: colours.widget_title_style, | ||
header_style: styles.table_header_style, | ||
border_style: styles.border_style, | ||
border_type: styles.border_type, | ||
highlighted_border_style: styles.highlighted_border_style, | ||
text_style: styles.text_style, | ||
highlighted_text_style: styles.selected_text_style, | ||
title_style: styles.widget_title_style, | ||
} | ||
} | ||
} |
Oops, something went wrong.