summaryrefslogtreecommitdiffstats
path: root/src/components/data_table/styling.rs
blob: 2f871887803abfa8b138cb3e9e8a31bec278026b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use tui::style::Style;

use crate::canvas::canvas_styling::CanvasColours;

#[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: &CanvasColours) -> 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,
        }
    }
}