theme: add title-font and bar-font settings
This commit is contained in:
parent
01f9c094ee
commit
035e2972de
14 changed files with 116 additions and 11 deletions
14
src/theme.rs
14
src/theme.rs
|
|
@ -463,6 +463,8 @@ pub struct Theme {
|
|||
pub colors: ThemeColors,
|
||||
pub sizes: ThemeSizes,
|
||||
pub font: CloneCell<Arc<String>>,
|
||||
pub bar_font: CloneCell<Option<Arc<String>>>,
|
||||
pub title_font: CloneCell<Option<Arc<String>>>,
|
||||
pub default_font: Arc<String>,
|
||||
}
|
||||
|
||||
|
|
@ -473,7 +475,19 @@ impl Default for Theme {
|
|||
colors: Default::default(),
|
||||
sizes: Default::default(),
|
||||
font: CloneCell::new(default_font.clone()),
|
||||
bar_font: Default::default(),
|
||||
title_font: Default::default(),
|
||||
default_font,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Theme {
|
||||
pub fn title_font(&self) -> Arc<String> {
|
||||
self.title_font.get().unwrap_or_else(|| self.font.get())
|
||||
}
|
||||
|
||||
pub fn bar_font(&self) -> Arc<String> {
|
||||
self.bar_font.get().unwrap_or_else(|| self.font.get())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue