summaryrefslogtreecommitdiffstats
path: root/src/canvas/tui_widgets/data_table/styling.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/canvas/tui_widgets/data_table/styling.rs')
-rw-r--r--src/canvas/tui_widgets/data_table/styling.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/canvas/tui_widgets/data_table/styling.rs b/src/canvas/tui_widgets/data_table/styling.rs
new file mode 100644
index 00000000..80ce2b70
--- /dev/null
+++ b/src/canvas/tui_widgets/data_table/styling.rs
@@ -0,0 +1,26 @@
+use tui::style::Style;
+
+use crate::canvas::styling::CanvasStyling;
+
+#[derive(Default)]
+pub struct DataTableStyling {
+ pub header_style: Style,
+ pub border_style: Style,
+ pub highlighted_border_style: Style,
+ pub text_style: Style,
+ pub highlighted_text_style: Style,
+ pub title_style: Style,
+}
+
+impl DataTableStyling {
+ pub fn from_colours(colours: &CanvasStyling) -> 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.currently_selected_text_style,
+ title_style: colours.widget_title_style,
+ }
+ }
+}