diff --git a/komorebi-for-mac/komorebi-bar/src/widgets/komorebi.rs b/komorebi-for-mac/komorebi-bar/src/widgets/komorebi.rs index 0b9cbaf5..170c9c78 100644 --- a/komorebi-for-mac/komorebi-bar/src/widgets/komorebi.rs +++ b/komorebi-for-mac/komorebi-bar/src/widgets/komorebi.rs @@ -113,7 +113,8 @@ pub struct KomorebiWorkspaceLayerConfig { pub struct KomorebiFocusedContainerConfig { /// Enable the Komorebi Focused Container widget pub enable: bool, - /// DEPRECATED: use 'display' instead (Show the icon of the currently focused container) + /// DEPRECATED: use `display` instead (Show the icon of the currently focused container) + #[deprecated(note = "Use `display` instead")] pub show_icon: Option, /// Display format of the currently focused container pub display: Option, @@ -530,7 +531,9 @@ impl FocusedContainerBar { if !value.enable { return None; } + // Handle legacy setting - convert show_icon to display format + #[allow(deprecated)] let format = value .display .unwrap_or(if value.show_icon.unwrap_or(false) { diff --git a/komorebi-for-mac/komorebi-bar/src/widgets/komorebi_layout.rs b/komorebi-for-mac/komorebi-bar/src/widgets/komorebi_layout.rs index c6b1c6a8..5c35246c 100644 --- a/komorebi-for-mac/komorebi-bar/src/widgets/komorebi_layout.rs +++ b/komorebi-for-mac/komorebi-bar/src/widgets/komorebi_layout.rs @@ -2,6 +2,7 @@ use crate::config::DisplayFormat; use crate::render::RenderConfig; use crate::selected_frame::SelectableFrame; use crate::widgets::komorebi::KomorebiLayoutConfig; +use color_eyre::eyre; use eframe::egui::Context; use eframe::egui::CornerRadius; use eframe::egui::FontId; @@ -24,6 +25,7 @@ use std::fmt::Formatter; #[derive(Copy, Clone, Debug, Serialize, PartialEq)] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +#[serde(untagged)] /// Komorebi layout kind pub enum KomorebiLayout { /// Predefined layout @@ -40,7 +42,7 @@ pub enum KomorebiLayout { } impl<'de> Deserialize<'de> for KomorebiLayout { - fn deserialize(deserializer: D) -> Result + fn deserialize(deserializer: D) -> eyre::Result where D: Deserializer<'de>, { @@ -146,7 +148,7 @@ impl KomorebiLayout { } else { ui.style().visuals.text_color() }; - let stroke = Stroke::new(1.0, color); + let stroke = Stroke::new(1.0_f32, color); let mut rect = response.rect; let rounding = CornerRadius::same((rect.width() * 0.1) as u8); rect = rect.shrink(stroke.width);