2023-01-05 14:16:27 +01:00
|
|
|
use crate::font;
|
|
|
|
|
use std::cell::RefCell;
|
|
|
|
|
|
|
|
|
|
thread_local! {
|
|
|
|
|
/// The fallback icon theme to search if no icon theme was specified.
|
|
|
|
|
pub(crate) static DEFAULT_ICON_THEME: RefCell<String> = RefCell::new(String::from("Pop"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// The fallback icon theme to search if no icon theme was specified.
|
|
|
|
|
#[must_use]
|
|
|
|
|
pub fn default_icon_theme() -> String {
|
|
|
|
|
DEFAULT_ICON_THEME.with(|f| f.borrow().clone())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Set the fallback icon theme to search when loading system icons.
|
|
|
|
|
pub fn set_default_icon_theme(name: impl Into<String>) {
|
|
|
|
|
DEFAULT_ICON_THEME.with(|f| *f.borrow_mut() = name.into());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Default iced settings for COSMIC applications.
|
|
|
|
|
#[must_use]
|
|
|
|
|
pub fn settings<Flags: Default>() -> iced::Settings<Flags> {
|
2023-02-20 14:26:31 -08:00
|
|
|
settings_with_flags(Flags::default())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Default iced settings for COSMIC applications.
|
|
|
|
|
#[must_use]
|
|
|
|
|
pub fn settings_with_flags<Flags>(flags: Flags) -> iced::Settings<Flags> {
|
2023-01-05 14:16:27 +01:00
|
|
|
iced::Settings {
|
2023-05-30 12:03:15 -04:00
|
|
|
default_font: font::FONT,
|
|
|
|
|
default_text_size: 18.0,
|
2023-02-20 14:26:31 -08:00
|
|
|
..iced::Settings::with_flags(flags)
|
2023-01-05 14:16:27 +01:00
|
|
|
}
|
|
|
|
|
}
|