use crossterm::style::Color;
use crate::html::box_edges::BoxEdges;
use crate::html::css_parse::{CornerRadii, TextAlign};
use super::inline_run::InlineRun;
#[derive(Debug, Clone)]
pub struct ColumnLayout {
pub lines: Vec<Vec<Vec<InlineRun>>>,
pub col_x: Vec<usize>,
pub col_width: usize,
pub rule_x: Vec<usize>,
pub rule_color: Option<Color>,
pub height: usize,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct ScrollbarLayout {
pub scroll_y: usize,
pub max_scroll: usize,
pub content_height: usize,
pub viewport_height: usize,
pub track: crate::layout::Rect,
pub thumb: crate::layout::Rect,
pub scroll_x: usize,
pub max_scroll_x: usize,
pub content_width: usize,
pub viewport_width: usize,
pub h_track: crate::layout::Rect,
pub h_thumb: crate::layout::Rect,
}
#[derive(Debug, Clone)]
pub struct PaintStyle {
pub box_edges: BoxEdges,
pub runs: Option<Vec<Vec<InlineRun>>>,
pub column_layout: Option<ColumnLayout>,
pub font_size_cells: usize,
pub line_height_cells: usize,
pub border_radius: CornerRadii,
pub fill_bg: bool,
pub spacing_after: usize,
pub text_align: TextAlign,
pub text_indent: usize,
pub scrollbar: Option<ScrollbarLayout>,
}
impl Default for PaintStyle {
fn default() -> Self {
Self {
box_edges: BoxEdges::default(),
runs: None,
column_layout: None,
font_size_cells: 1,
line_height_cells: 1,
border_radius: CornerRadii::default(),
fill_bg: false,
spacing_after: 0,
text_align: TextAlign::Left,
text_indent: 0,
scrollbar: None,
}
}
}