diff options
author | Canop <cano.petrole@gmail.com> | 2020-05-15 21:35:12 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2020-05-15 21:35:12 +0200 |
commit | a746262f8591da6268ce9416296ee64853768f30 (patch) | |
tree | 9666451343e3f6e8de6338731a24bccd333121ce /src/launchable.rs | |
parent | e49c8ca18ef0eeb013caa89a4ab27eac11292588 (diff) |
different skins for focused and unfocused panels
(when an unfocused style isn't defined, we use the focused one)
Diffstat (limited to 'src/launchable.rs')
-rw-r--r-- | src/launchable.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/launchable.rs b/src/launchable.rs index 08a890e..80031ef 100644 --- a/src/launchable.rs +++ b/src/launchable.rs @@ -2,7 +2,7 @@ use { crate::{ display::{DisplayableTree, Screen}, errors::ProgramError, - skin::Skin, + skin::StyleMap, tree::Tree, }, open, @@ -20,7 +20,7 @@ pub enum Launchable { TreePrinter { // print the tree on end of broot tree: Box<Tree>, - skin: Box<Skin>, + skin: Box<StyleMap>, width: u16, }, Program { @@ -57,14 +57,14 @@ impl Launchable { pub fn printer(to_print: String) -> Launchable { Launchable::Printer { to_print } } - pub fn tree_printer(tree: &Tree, screen: &Screen, no_style: bool) -> Launchable { + pub fn tree_printer( + tree: &Tree, + screen: &Screen, + style_map: StyleMap, + ) -> Launchable { Launchable::TreePrinter { tree: Box::new(tree.clone()), - skin: Box::new(if no_style { - Skin::no_term() - } else { - screen.skin.clone() - }), + skin: Box::new(style_map), width: screen.width, } } |