diff --git a/src/app/settings.rs b/src/app/settings.rs index 0745fc95..d6f9cdbd 100644 --- a/src/app/settings.rs +++ b/src/app/settings.rs @@ -29,7 +29,7 @@ pub struct Settings { pub(crate) default_font: Font, /// Name of the icon theme to search by default. - #[setters(into)] + #[setters(skip)] pub(crate) default_icon_theme: Option, /// Default size of fonts. @@ -56,6 +56,15 @@ pub struct Settings { pub(crate) transparent: bool, } +impl Settings { + /// Sets the default icon theme, passing an empty string will unset the theme. + pub fn default_icon_theme(mut self, value: impl Into) -> Self { + let value: String = value.into(); + self.default_icon_theme = if value.is_empty() { None } else { Some(value) }; + self + } +} + impl Default for Settings { fn default() -> Self { Self {