Add _with_flags() variants to settings helpers (#85)
This commit is contained in:
parent
8232e1d249
commit
2dde95ee42
3 changed files with 24 additions and 12 deletions
|
|
@ -20,12 +20,18 @@ pub fn set_default_icon_theme(name: impl Into<String>) {
|
|||
/// Default iced settings for COSMIC applications.
|
||||
#[must_use]
|
||||
pub fn settings<Flags: Default>() -> iced::Settings<Flags> {
|
||||
settings_with_flags(Flags::default())
|
||||
}
|
||||
|
||||
/// Default iced settings for COSMIC applications.
|
||||
#[must_use]
|
||||
pub fn settings_with_flags<Flags>(flags: Flags) -> iced::Settings<Flags> {
|
||||
iced::Settings {
|
||||
default_font: match font::FONT {
|
||||
iced::Font::Default => None,
|
||||
iced::Font::External { bytes, .. } => Some(bytes),
|
||||
},
|
||||
default_text_size: 18,
|
||||
..iced::Settings::default()
|
||||
..iced::Settings::with_flags(flags)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue