diff --git a/src/app/settings.rs b/src/app/settings.rs index 93cda035..fd71e6df 100644 --- a/src/app/settings.rs +++ b/src/app/settings.rs @@ -26,7 +26,7 @@ pub struct Settings { pub(crate) default_font: Font, /// Name of the icon theme to search by default. - #[setters(into, strip_option)] + #[setters(skip)] pub(crate) default_icon_theme: Option, /// Default size of fonts. @@ -53,6 +53,19 @@ 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.to_string()) + }; + self + } +} + impl Default for Settings { fn default() -> Self { Self {