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
27
28
29
30
31
32
33
34
35
36
37
38
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()
}
}