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
@@ -29,7 +29,7 @@ impl Backlight {
self.max = read_file_as_u64(self.device_path.join("max_brightness").as_path()).unwrap();
}
pub fn new(path: &str) -> BarWidget {
pub fn new(path: &str, font: &'static str, size: f32) -> BarWidget {
let mut dev = Backlight {
device_path: Path::new("/sys/class/backlight").to_path_buf().join(path),
cur: 0,
@@ -38,7 +38,7 @@ impl Backlight {
};
dev.update();
BarWidget::new(Box::new(dev))
BarWidget::new(Box::new(dev), font, size)
}
}