feat: Add option for frozen glass in maximized windows
This commit is contained in:
parent
1f6dc991ea
commit
0ca1b784c9
2 changed files with 17 additions and 8 deletions
|
|
@ -121,6 +121,9 @@ pub struct Theme {
|
||||||
/// frosted applet popups
|
/// frosted applet popups
|
||||||
pub frosted_applets: bool,
|
pub frosted_applets: bool,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
|
/// frosted apps when maximized
|
||||||
|
pub frosted_maximized_apps: bool,
|
||||||
|
#[serde(default)]
|
||||||
/// alpha map
|
/// alpha map
|
||||||
pub alpha_map: AlphaMap,
|
pub alpha_map: AlphaMap,
|
||||||
/// shade color for dialogs
|
/// shade color for dialogs
|
||||||
|
|
@ -909,6 +912,9 @@ pub struct ThemeBuilder {
|
||||||
/// frosted applet popups
|
/// frosted applet popups
|
||||||
pub frosted_applets: bool,
|
pub frosted_applets: bool,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
|
/// frosted apps when maximized
|
||||||
|
pub frosted_maximized_apps: bool,
|
||||||
|
#[serde(default)]
|
||||||
/// alpha map
|
/// alpha map
|
||||||
pub alpha_map: AlphaMap,
|
pub alpha_map: AlphaMap,
|
||||||
}
|
}
|
||||||
|
|
@ -937,6 +943,7 @@ impl Default for ThemeBuilder {
|
||||||
frosted_system_interface: false,
|
frosted_system_interface: false,
|
||||||
frosted_panel: false,
|
frosted_panel: false,
|
||||||
frosted_applets: false,
|
frosted_applets: false,
|
||||||
|
frosted_maximized_apps: false,
|
||||||
alpha_map: AlphaMap::default(),
|
alpha_map: AlphaMap::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1084,6 +1091,7 @@ impl ThemeBuilder {
|
||||||
frosted_system_interface,
|
frosted_system_interface,
|
||||||
frosted_panel,
|
frosted_panel,
|
||||||
frosted_applets,
|
frosted_applets,
|
||||||
|
frosted_maximized_apps,
|
||||||
alpha_map,
|
alpha_map,
|
||||||
} = self;
|
} = self;
|
||||||
|
|
||||||
|
|
@ -1556,6 +1564,7 @@ impl ThemeBuilder {
|
||||||
frosted_system_interface,
|
frosted_system_interface,
|
||||||
frosted_panel,
|
frosted_panel,
|
||||||
frosted_applets,
|
frosted_applets,
|
||||||
|
frosted_maximized_apps,
|
||||||
alpha_map,
|
alpha_map,
|
||||||
transparent_background: Container::new(
|
transparent_background: Container::new(
|
||||||
Component::component(
|
Component::component(
|
||||||
|
|
|
||||||
|
|
@ -549,16 +549,16 @@ where
|
||||||
pub fn style(&self, theme: &Theme) -> theme::Style {
|
pub fn style(&self, theme: &Theme) -> theme::Style {
|
||||||
if let Some(style) = self.app.style() {
|
if let Some(style) = self.app.style() {
|
||||||
style
|
style
|
||||||
} else if self.app.core().window.is_maximized {
|
|
||||||
let theme = THEME.lock().unwrap();
|
|
||||||
crate::style::iced::application::style(theme.borrow())
|
|
||||||
} else {
|
} else {
|
||||||
let theme = THEME.lock().unwrap();
|
let theme = THEME.lock().unwrap();
|
||||||
|
if self.app.core().window.is_maximized && !theme.cosmic().frosted_maximized_apps {
|
||||||
theme::Style {
|
crate::style::iced::application::style(theme.borrow())
|
||||||
background_color: iced_core::Color::TRANSPARENT,
|
} else {
|
||||||
icon_color: theme.cosmic().on_bg_color().into(),
|
theme::Style {
|
||||||
text_color: theme.cosmic().on_bg_color().into(),
|
background_color: iced_core::Color::TRANSPARENT,
|
||||||
|
icon_color: theme.cosmic().on_bg_color().into(),
|
||||||
|
text_color: theme.cosmic().on_bg_color().into(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue