diff --git a/komorebi-bar/src/bar.rs b/komorebi-bar/src/bar.rs index 856bf7b5..b62ff072 100644 --- a/komorebi-bar/src/bar.rs +++ b/komorebi-bar/src/bar.rs @@ -352,7 +352,7 @@ impl Komobar { grouping: Grouping::None, background_color: Color32::BLACK, alignment: None, - no_spacing: None, + no_spacing: false, })), komorebi_notification_state: None, left_widgets: vec![], @@ -486,7 +486,7 @@ impl eframe::App for Komobar { w.render(ctx, ui, render_conf); } - render_conf.no_spacing = Some(true); + render_conf.no_spacing = true; last.render(ctx, ui, render_conf); } }); @@ -503,7 +503,7 @@ impl eframe::App for Komobar { w.render(ctx, ui, render_conf); } - render_conf.no_spacing = Some(true); + render_conf.no_spacing = true; last.render(ctx, ui, render_conf); } }); diff --git a/komorebi-bar/src/render.rs b/komorebi-bar/src/render.rs index fe6330ae..d6efcbcb 100644 --- a/komorebi-bar/src/render.rs +++ b/komorebi-bar/src/render.rs @@ -36,7 +36,7 @@ pub struct RenderConfig { /// Alignment of the widgets pub alignment: Option, /// Remove spacing if true - pub no_spacing: Option, + pub no_spacing: bool, } pub trait RenderExt { @@ -50,7 +50,7 @@ impl RenderExt for &KomobarConfig { grouping: self.grouping.unwrap_or(Grouping::None), background_color, alignment: None, - no_spacing: None, + no_spacing: false, } } } @@ -90,7 +90,7 @@ impl RenderConfig { // TODO: this should remove the margin on the last widget on the left side and the first widget on the right side // This is complex, since the last/first widget can have multiple "sections", like komorebi, network, ... // This and the same setting on RenderConfig needs to be combined. - //_first_or_last: Option, + //no_spacing: Option, ui: &mut Ui, add_contents: impl FnOnce(&mut Ui) -> R, ) -> InnerResponse { @@ -167,7 +167,7 @@ impl RenderConfig { Some(align) => match align { Alignment::Left => 0.0, Alignment::Right => { - if self.no_spacing.is_some_and(|v| v) { + if self.no_spacing { 0.0 } else { self.spacing @@ -179,7 +179,7 @@ impl RenderConfig { right: match self.alignment { Some(align) => match align { Alignment::Left => { - if self.no_spacing.is_some_and(|v| v) { + if self.no_spacing { 0.0 } else { self.spacing