| 1 | use ratatui::{style::Style, widgets::BorderType}; |
| 2 | |
| 3 | use crate::options::config::style::Styles; |
| 4 | |
| 5 | #[derive(Default)] |
| 6 | pub struct DataTableStyling { |
| 7 | pub header_style: Style, |
| 8 | pub border_style: Style, |
| 9 | pub border_type: BorderType, |
| 10 | pub highlighted_border_style: Style, |
| 11 | pub text_style: Style, |
| 12 | pub highlighted_text_style: Style, |
| 13 | pub title_style: Style, |
| 14 | pub general_widget_style: Style, |
| 15 | } |
| 16 | |
| 17 | impl DataTableStyling { |
| 18 | pub fn from_palette(styles: &Styles) -> Self { |
| 19 | Self { |
| 20 | header_style: styles.table_header_style, |
| 21 | border_style: styles.border_style, |
| 22 | border_type: styles.border_type, |
| 23 | highlighted_border_style: styles.highlighted_border_style, |
| 24 | text_style: styles.text_style, |
| 25 | highlighted_text_style: styles.selected_text_style, |
| 26 | title_style: styles.widget_title_style, |
| 27 | general_widget_style: styles.general_widget_style, |
| 28 | } |
| 29 | } |
| 30 | } |