feat(bar): add basic widget config opts

This commit is contained in:
LGUG2Z
2024-08-27 18:22:36 -07:00
parent bc2f4a172e
commit ca6bf69ac7
5 changed files with 158 additions and 101 deletions
+6 -5
View File
@@ -1,5 +1,6 @@
use crate::widget::BarWidget;
#[derive(Copy, Clone, Debug)]
pub enum TimeFormat {
TwelveHour,
TwentyFourHour,
@@ -21,15 +22,15 @@ impl TimeFormat {
}
}
#[derive(Copy, Clone, Debug)]
pub struct Time {
pub enable: bool,
pub format: TimeFormat,
}
impl Default for Time {
fn default() -> Self {
Self {
format: TimeFormat::TwelveHour,
}
impl Time {
pub fn new(enable: bool, format: TimeFormat) -> Self {
Self { enable, format }
}
}