use {
crate::{
color::*,
styled_char::StyledChar,
},
crossterm::style::Color,
};
#[derive(Clone, Debug)]
pub struct ScrollBarStyle {
pub track: StyledChar,
pub thumb: StyledChar,
}
impl ScrollBarStyle {
pub fn new() -> Self {
let char = '▐';
Self {
track: StyledChar::from_fg_char(gray(5), char),
thumb: StyledChar::from_fg_char(gray(21), char),
}
}
pub fn set_bg(&mut self, bg: Color) {
self.track.set_bg(bg);
self.thumb.set_bg(bg);
}
}
impl Default for ScrollBarStyle {
fn default() -> Self {
Self::new()
}
}