1 use {
2     super::*,
3     crate::{
4         conf::Conf,
5     },
6     ahash::AHashMap,
7 };
8 
9 
10 /// all the skin things used by the broot application
11 /// during runing
12 pub struct AppSkin {
13 
14     /// the skin used in the focused panel
15     pub focused: PanelSkin,
16 
17     /// the skin used in unfocused panels
18     pub unfocused: PanelSkin,
19 }
20 
21 impl AppSkin {
new(conf: &Conf, no_style: bool) -> Self22     pub fn new(conf: &Conf, no_style: bool) -> Self {
23         if no_style {
24             Self {
25                 focused: PanelSkin::new(StyleMap::no_term()),
26                 unfocused: PanelSkin::new(StyleMap::no_term()),
27             }
28         } else {
29             let def_skin;
30             let skin = if let Some(skin) = &conf.skin {
31                 skin
32             } else {
33                 def_skin = AHashMap::default();
34                 &def_skin
35             };
36             let StyleMaps { focused, unfocused } = StyleMaps::create(skin);
37             Self {
38                 focused: PanelSkin::new(focused),
39                 unfocused: PanelSkin::new(unfocused),
40             }
41         }
42     }
43 
44 }
45