chore: allow &str as input for the icon theme
This commit is contained in:
parent
12da20d184
commit
78c1facd5b
1 changed files with 10 additions and 1 deletions
|
|
@ -29,7 +29,7 @@ pub struct Settings {
|
||||||
pub(crate) default_font: Font,
|
pub(crate) default_font: Font,
|
||||||
|
|
||||||
/// Name of the icon theme to search by default.
|
/// Name of the icon theme to search by default.
|
||||||
#[setters(into)]
|
#[setters(skip)]
|
||||||
pub(crate) default_icon_theme: Option<String>,
|
pub(crate) default_icon_theme: Option<String>,
|
||||||
|
|
||||||
/// Default size of fonts.
|
/// Default size of fonts.
|
||||||
|
|
@ -56,6 +56,15 @@ pub struct Settings {
|
||||||
pub(crate) transparent: bool,
|
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<String>) -> Self {
|
||||||
|
let value: String = value.into();
|
||||||
|
self.default_icon_theme = if value.is_empty() { None } else { Some(value) };
|
||||||
|
self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Default for Settings {
|
impl Default for Settings {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue