diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-01-23 19:52:54 +0200 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-01-23 19:52:54 +0200 |
commit | 1e2b3c073d8b6ba3634774c54ddcfd4d612c8acb (patch) | |
tree | 8b95ac15d1cecc5ded1861f49e4edee0a910d0fa /ui/src/components/utilities.rs | |
parent | f787eb75b63858bbc495dd7df1938f7ad52f2699 (diff) |
ui/themes: add ThemeAttribute
Consolidate {fg,bg} color theme settings to ThemeAttribute and add Attr
(bold, etc).
Diffstat (limited to 'ui/src/components/utilities.rs')
-rw-r--r-- | ui/src/components/utilities.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/ui/src/components/utilities.rs b/ui/src/components/utilities.rs index 21f5ac89..46bde9e5 100644 --- a/ui/src/components/utilities.rs +++ b/ui/src/components/utilities.rs @@ -264,12 +264,6 @@ impl Component for VSplit { } } -#[derive(Debug, Default, Clone, Copy)] -pub struct PagerColors { - pub fg: Color, - pub bg: Color, -} - #[derive(Debug, Clone, Copy)] pub enum PageMovement { Up(usize), @@ -295,7 +289,7 @@ pub struct Pager { minimum_width: usize, dirty: bool, - colors: PagerColors, + colors: ThemeAttribute, initialised: bool, content: CellBuffer, movement: Option<PageMovement>, @@ -346,7 +340,7 @@ impl Pager { context: Option<&Context>, cursor_pos: Option<usize>, mut width: Option<usize>, - colors: PagerColors, + colors: ThemeAttribute, ) -> Self { let pager_filter: Option<&String> = if let Some(context) = context { context.settings.pager.filter.as_ref() @@ -435,7 +429,7 @@ impl Pager { text: &str, cursor_pos: Option<usize>, width: Option<usize>, - colors: PagerColors, + colors: ThemeAttribute, ) -> Self { let lines: Vec<String> = if let Some(width) = width { text.split_lines(width) @@ -477,7 +471,7 @@ impl Pager { ..Default::default() } } - pub fn print_string(content: &mut CellBuffer, lines: Vec<String>, colors: PagerColors) { + pub fn print_string(content: &mut CellBuffer, lines: Vec<String>, colors: ThemeAttribute) { let width = content.size().0; debug!(colors); for (i, l) in lines.iter().enumerate() { |