clock: Use font metrics for size

This commit is contained in:
Kenny Levinsen
2020-06-14 17:01:42 +02:00
parent 48985c470a
commit 2f61da8690
3 changed files with 39 additions and 10 deletions
+5 -2
View File
@@ -111,11 +111,14 @@ impl Widget {
.map(|x| x.unwrap())
.collect(),
)),
Widget::Clock { font, font_size } => Some(widgets::clock::Clock::new(
Widget::Clock { font, font_size } => match widgets::clock::Clock::new(
time,
get_font(&font.or_else(|| Some("sans".to_string())).unwrap(), &fonts),
font_size,
)),
) {
Ok(w) => Some(w),
Err(_) => None,
},
Widget::Date { font, font_size } => Some(widgets::date::Date::new(
time,
get_font(&font.or_else(|| Some("sans".to_string())).unwrap(), &fonts),