Refactor slightly

This commit is contained in:
Kenny Levinsen
2023-01-13 21:53:07 +01:00
parent b2a9475e4c
commit 3a40bb18c5
9 changed files with 513 additions and 493 deletions
+2 -2
View File
@@ -111,7 +111,7 @@ pub struct Battery {
}
impl Battery {
pub fn new(ping: Ping) -> BarWidget {
pub fn new(ping: Ping, font: &'static str, size: f32) -> BarWidget {
let battery = Battery {
inner: Arc::new(Mutex::new(InnerBattery {
value: 0.,
@@ -120,7 +120,7 @@ impl Battery {
dirty: false,
};
start_monitor(battery.inner.clone(), ping);
BarWidget::new(Box::new(battery))
BarWidget::new(Box::new(battery), font, size)
}
}