feat: CosmicTk::header_size density config
This commit is contained in:
parent
f0bfa87a36
commit
6720b8277c
8 changed files with 118 additions and 79 deletions
|
|
@ -73,9 +73,6 @@ pub struct Core {
|
|||
/// Configured theme mode
|
||||
pub(super) system_theme_mode: ThemeMode,
|
||||
|
||||
/// Libcosmic toolkit configuration.
|
||||
pub(super) toolkit_config: CosmicTk,
|
||||
|
||||
pub(super) portal_is_dark: Option<bool>,
|
||||
|
||||
pub(super) portal_accent: Option<Srgba>,
|
||||
|
|
@ -123,16 +120,6 @@ impl Default for Core {
|
|||
})
|
||||
})
|
||||
.unwrap_or_default(),
|
||||
toolkit_config: CosmicTk::config()
|
||||
.map(|c| {
|
||||
CosmicTk::get_entry(&c).unwrap_or_else(|(errors, mode)| {
|
||||
for why in errors {
|
||||
tracing::error!(?why, "CosmicTk config entry error");
|
||||
}
|
||||
mode
|
||||
})
|
||||
})
|
||||
.unwrap_or_default(),
|
||||
window: Window {
|
||||
context_title: String::new(),
|
||||
header_title: String::new(),
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ where
|
|||
self.app.subscription().map(super::Message::App),
|
||||
self.app
|
||||
.core()
|
||||
.watch_config::<crate::config::CosmicTk>(crate::config::toolkit::ID)
|
||||
.watch_config::<crate::config::CosmicTk>(crate::config::ID)
|
||||
.map(|update| {
|
||||
for why in update.errors {
|
||||
tracing::error!(?why, "cosmic toolkit config update error");
|
||||
|
|
@ -628,7 +628,7 @@ impl<T: Application> Cosmic<T> {
|
|||
crate::icon_theme::set_default(config.icon_theme.clone());
|
||||
}
|
||||
|
||||
self.app.core_mut().toolkit_config = config;
|
||||
crate::config::COSMIC_TK.with(|tk| *tk.borrow_mut() = config);
|
||||
}
|
||||
|
||||
Message::Focus(f) => {
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ pub(crate) fn iced_settings<App: Application>(
|
|||
if let Some(icon_theme) = settings.default_icon_theme {
|
||||
crate::icon_theme::set_default(icon_theme);
|
||||
} else {
|
||||
crate::icon_theme::set_default(core.toolkit_config.icon_theme.clone());
|
||||
crate::icon_theme::set_default(crate::config::icon_theme());
|
||||
}
|
||||
|
||||
THEME.with(move |t| {
|
||||
|
|
@ -714,11 +714,11 @@ impl<App: Application> ApplicationExt for App {
|
|||
header = header.start(toggle);
|
||||
}
|
||||
|
||||
if core.window.show_maximize && core.toolkit_config.show_maximize {
|
||||
if core.window.show_maximize && crate::config::show_maximize() {
|
||||
header = header.on_maximize(Message::Cosmic(cosmic::Message::Maximize));
|
||||
}
|
||||
|
||||
if core.window.show_minimize && core.toolkit_config.show_minimize {
|
||||
if core.window.show_minimize && crate::config::show_minimize() {
|
||||
header = header.on_minimize(Message::Cosmic(cosmic::Message::Minimize));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue