feat: reapply frosted glass feature

This commit is contained in:
Ashley Wulber 2026-07-10 13:06:17 -04:00 committed by GitHub
parent ae5c750662
commit fff1485876
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
125 changed files with 1883 additions and 424 deletions

917
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -70,8 +70,8 @@ debug = true
# cosmic-text = { git = "https://github.com/pop-os/cosmic-text//", rev = "b017d7c" } # cosmic-text = { git = "https://github.com/pop-os/cosmic-text//", rev = "b017d7c" }
[patch.'https://github.com/pop-os/cosmic-protocols'] [patch.'https://github.com/pop-os/cosmic-protocols']
cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols//", rev = "d0e95be" } cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols//", rev = "32283d7" }
cosmic-client-toolkit = { git = "https://github.com/pop-os/cosmic-protocols//", rev = "d0e95be" } cosmic-client-toolkit = { git = "https://github.com/pop-os/cosmic-protocols//", rev = "32283d7" }
# [patch.'https://github.com/pop-os/cosmic-settings-daemon'] # [patch.'https://github.com/pop-os/cosmic-settings-daemon']
# cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon//", branch = "input_nobuild" } # cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon//", branch = "input_nobuild" }
@ -83,12 +83,11 @@ cosmic-client-toolkit = { git = "https://github.com/pop-os/cosmic-protocols//",
# cosmic-theme = { path = "../libcosmic/cosmic-theme" } # cosmic-theme = { path = "../libcosmic/cosmic-theme" }
# iced_futures = { path = "../libcosmic/iced/futures" } # iced_futures = { path = "../libcosmic/iced/futures" }
# iced_winit = { path = "../libcosmic/iced/winit" } # iced_winit = { path = "../libcosmic/iced/winit" }
# iced_futures = { git = "https://github.com/pop-os/libcosmic//", branch = "theme-v2" }
# libcosmic = { git = "https://github.com/pop-os/libcosmic//" } # libcosmic = { git = "https://github.com/pop-os/libcosmic//", branch = "theme-v2" }
# cosmic-config = { git = "https://github.com/pop-os/libcosmic//" } # cosmic-config = { git = "https://github.com/pop-os/libcosmic//", branch = "theme-v2" }
# cosmic-theme = { git = "https://github.com/pop-os/libcosmic//" } # cosmic-theme = { git = "https://github.com/pop-os/libcosmic//", branch = "theme-v2" }
# iced_futures = { git = "https://github.com/pop-os/libcosmic//" } # iced_winit = { git = "https://github.com/pop-os/libcosmic//", branch = "theme-v2" }
# iced_winit = { git = "https://github.com/pop-os/libcosmic//" }
# [patch.'https://github.com/pop-os/dbus-settings-bindings'] # [patch.'https://github.com/pop-os/dbus-settings-bindings']
# cosmic-dbus-networkmanager = { path = "../dbus-settings-bindings/networkmanager" } # cosmic-dbus-networkmanager = { path = "../dbus-settings-bindings/networkmanager" }

View file

@ -2,9 +2,10 @@ use cosmic::app::{ContextDrawer, context_drawer};
use cosmic::config::CosmicTk; use cosmic::config::CosmicTk;
use cosmic::cosmic_config::{Config, ConfigSet}; use cosmic::cosmic_config::{Config, ConfigSet};
use cosmic::cosmic_theme::Spacing; use cosmic::cosmic_theme::Spacing;
use cosmic::iced::Alignment;
use cosmic::iced::core::{Color, Length}; use cosmic::iced::core::{Color, Length};
use cosmic::widget::color_picker::ColorPickerUpdate; use cosmic::widget::color_picker::ColorPickerUpdate;
use cosmic::widget::{ColorPickerModel, container, flex_row, settings, text}; use cosmic::widget::{ColorPickerModel, container, flex_row, row, settings, slider, text};
use cosmic::{Apply, Element, Task, task, widget}; use cosmic::{Apply, Element, Task, task, widget};
use cosmic_config::ConfigGet; use cosmic_config::ConfigGet;
use std::sync::Arc; use std::sync::Arc;
@ -35,6 +36,12 @@ pub struct Content {
icon_themes: IconThemes, icon_themes: IconThemes,
icon_handles: IconHandles, icon_handles: IconHandles,
tk_config: Option<Config>, tk_config: Option<Config>,
frosted: u8,
glass: f32,
frosted_system_interface: bool,
frosted_windows: bool,
frosted_panel: bool,
frosted_applets: bool,
comp_config: cosmic_config::Config, comp_config: cosmic_config::Config,
#[cfg(feature = "cosmic-comp-config")] #[cfg(feature = "cosmic-comp-config")]
@ -89,7 +96,7 @@ impl From<&theme_manager::Manager> for Content {
application_background: ColorPickerModel::new( application_background: ColorPickerModel::new(
&*HEX, &*HEX,
&*RGB, &*RGB,
Some(theme.background.base.into()), Some(theme.background(false).base.into()),
theme_manager.get_color(&ContextView::ApplicationBackground), theme_manager.get_color(&ContextView::ApplicationBackground),
), ),
container_background: ColorPickerModel::new( container_background: ColorPickerModel::new(
@ -101,7 +108,7 @@ impl From<&theme_manager::Manager> for Content {
interface_text: ColorPickerModel::new( interface_text: ColorPickerModel::new(
&*HEX, &*HEX,
&*RGB, &*RGB,
Some(theme.background.on.into()), Some(theme.background(false).on.into()),
theme_manager.get_color(&ContextView::InterfaceText), theme_manager.get_color(&ContextView::InterfaceText),
), ),
control_component: ColorPickerModel::new( control_component: ColorPickerModel::new(
@ -117,6 +124,12 @@ impl From<&theme_manager::Manager> for Content {
theme_manager.get_color(&ContextView::AccentWindowHint), theme_manager.get_color(&ContextView::AccentWindowHint),
), ),
font_config: font_config::Model::new(), font_config: font_config::Model::new(),
frosted: theme.frosted as u8,
glass: theme.alpha_map.guess_offset(),
frosted_system_interface: theme.frosted_system_interface,
frosted_windows: theme.frosted_windows,
frosted_panel: theme.frosted_panel,
frosted_applets: theme.frosted_applets,
icons_fetched: false, icons_fetched: false,
icon_global: cosmic::config::apply_theme_global(), icon_global: cosmic::config::apply_theme_global(),
icon_fetch_handle: None, icon_fetch_handle: None,
@ -280,6 +293,40 @@ impl Content {
Task::none() Task::none()
} }
pub fn update_frosted_system_interface(&mut self, v: bool) -> Task<app::Message> {
self.frosted_system_interface = v;
Task::none()
}
pub fn update_frosted_windows(&mut self, v: bool) -> Task<app::Message> {
self.frosted_windows = v;
Task::none()
}
pub fn update_frosted_panel(&mut self, v: bool) -> Task<app::Message> {
self.frosted_panel = v;
Task::none()
}
pub fn update_frosted_applets(&mut self, v: bool) -> Task<app::Message> {
self.frosted_applets = v;
Task::none()
}
pub fn update_blur(&mut self, v: u8) -> Task<app::Message> {
self.frosted = v;
Task::none()
}
pub fn update_glass(&mut self, v: f32) -> Task<app::Message> {
self.glass = v;
Task::none()
}
pub fn on_open(&mut self, context_view: &ContextView) -> Task<app::Message> { pub fn on_open(&mut self, context_view: &ContextView) -> Task<app::Message> {
match *context_view { match *context_view {
ContextView::IconsAndToolkit => { ContextView::IconsAndToolkit => {
@ -327,7 +374,7 @@ impl Content {
self.application_background = ColorPickerModel::new( self.application_background = ColorPickerModel::new(
&*HEX, &*HEX,
&*RGB, &*RGB,
Some(manager.theme().background.base.into()), Some(manager.theme().background(false).base.into()),
manager.get_color(&ContextView::ApplicationBackground), manager.get_color(&ContextView::ApplicationBackground),
); );
self.custom_accent = ColorPickerModel::new( self.custom_accent = ColorPickerModel::new(
@ -345,7 +392,7 @@ impl Content {
self.interface_text = ColorPickerModel::new( self.interface_text = ColorPickerModel::new(
&*HEX, &*HEX,
&*RGB, &*RGB,
Some(manager.theme().background.on.into()), Some(manager.theme().background(false).on.into()),
manager.get_color(&ContextView::InterfaceText), manager.get_color(&ContextView::InterfaceText),
); );
self.control_component = ColorPickerModel::new( self.control_component = ColorPickerModel::new(
@ -471,6 +518,10 @@ impl Content {
self.shadow_and_corners(), self.shadow_and_corners(),
crate::pages::Message::CloseContextDrawer, crate::pages::Message::CloseContextDrawer,
), ),
ContextView::FrostedGlass => context_drawer(
self.frosted_glass(),
crate::pages::Message::CloseContextDrawer,
),
}) })
} }
@ -554,4 +605,66 @@ impl Content {
.apply(Element::from) .apply(Element::from)
.map(crate::pages::Message::Appearance) .map(crate::pages::Message::Appearance)
} }
pub fn frosted_glass(&self) -> Element<'_, crate::pages::Message> {
settings::section()
.add(
settings::item::builder(fl!("style", "frosted-panels"))
.description(fl!("style", "frosted-panels-desc"))
.toggler(self.frosted_panel, Message::FrostedPanel),
)
.add(
settings::item::builder(fl!("style", "frosted-applets"))
.description(fl!("style", "frosted-applets-desc"))
.toggler(self.frosted_applets, Message::FrostedApplets),
)
.add(
settings::item::builder(fl!("style", "frosted-system-interface"))
.description(fl!("style", "frosted-system-interface-desc"))
.toggler(
self.frosted_system_interface,
Message::FrostedSystemInterface,
),
)
.add(
settings::item::builder(fl!("style", "frosted-windows"))
.description(fl!("style", "frosted-windows-desc"))
.toggler(self.frosted_windows, Message::FrostedWindows),
)
.add(
settings::item::builder(fl!("style", "frosted-thickness")).flex_control({
row::with_children(vec![
text::body(fl!("style", "less")).into(),
slider(0..=13, self.frosted, Message::Blur)
.width(Length::Fill)
.apply(cosmic::widget::container)
.max_width(250)
.into(),
text::body(fl!("style", "more")).into(),
])
.align_y(Alignment::Center)
.spacing(8)
.width(Length::Fill)
}),
)
.add(
settings::item::builder(fl!("style", "glass-opacity")).flex_control({
row::with_children(vec![
text::body(fl!("style", "less")).into(),
slider(0.0..=1.0, self.glass, Message::Glass)
.step(0.05)
.width(Length::Fill)
.apply(cosmic::widget::container)
.max_width(250)
.into(),
text::body(fl!("style", "more")).into(),
])
.align_y(Alignment::Center)
.spacing(8)
.width(Length::Fill)
}),
)
.apply(Element::from)
.map(crate::pages::Message::Appearance)
}
} }

View file

@ -41,6 +41,7 @@ pub enum ContextView {
ApplicationBackground, ApplicationBackground,
ContainerBackground, ContainerBackground,
ControlComponent, ControlComponent,
FrostedGlass,
#[cfg(feature = "cosmic-comp-config")] #[cfg(feature = "cosmic-comp-config")]
ShadowAndCorners, ShadowAndCorners,
CustomAccent, CustomAccent,
@ -159,6 +160,12 @@ pub enum Message {
UseDefaultWindowHint(bool), UseDefaultWindowHint(bool),
WindowHintSize(u32), WindowHintSize(u32),
Daytime(bool), Daytime(bool),
Blur(u8),
Glass(f32),
FrostedPanel(bool),
FrostedApplets(bool),
FrostedSystemInterface(bool),
FrostedWindows(bool),
} }
impl From<Message> for crate::app::Message { impl From<Message> for crate::app::Message {
@ -193,6 +200,7 @@ impl Page {
Message::DrawerOpen(context_view) => { Message::DrawerOpen(context_view) => {
self.context_view = Some(context_view); self.context_view = Some(context_view);
self.drawer = drawer::Content::from(&self.theme_manager);
tasks.push(cosmic::task::message( tasks.push(cosmic::task::message(
crate::app::Message::OpenContextDrawer(self.entity), crate::app::Message::OpenContextDrawer(self.entity),
)); ));
@ -528,6 +536,66 @@ impl Page {
}); });
} }
} }
Message::Blur(b) => {
let Ok(blur_strength) = b.try_into() else {
tracing::error!("Invalid blur strength: {b}");
return Task::none();
};
theme_staged = self.theme_manager.set_frosted(blur_strength).map(|_| {
self.drawer.reset(&self.theme_manager);
theme_manager::ThemeStaged::Current
});
tasks.push(self.drawer.update_blur(blur_strength as u8));
}
Message::Glass(glass) => {
let mut alpha_map = cosmic::cosmic_theme::AlphaMap::default();
let glass_offset_min = alpha_map.extremely_high_2;
let glass_offset_max = 1.0 - alpha_map.extremely_low;
let offset = (glass - 0.5) / 0.5
* if glass < 0.5 {
glass_offset_min
} else {
glass_offset_max
};
alpha_map = alpha_map.offset(offset);
// TODO optimize and apply to both light and dark themes
theme_staged = self.theme_manager.set_glass(alpha_map).map(|_| {
self.drawer.reset(&self.theme_manager);
theme_manager::ThemeStaged::Current
});
tasks.push(self.drawer.update_glass(glass));
}
Message::FrostedSystemInterface(v) => {
theme_staged = self.theme_manager.set_frosted_system_interface(v).map(|_| {
self.drawer.reset(&self.theme_manager);
theme_manager::ThemeStaged::Current
});
tasks.push(self.drawer.update_frosted_system_interface(v));
}
Message::FrostedWindows(v) => {
theme_staged = self.theme_manager.set_frosted_windows(v).map(|_| {
self.drawer.reset(&self.theme_manager);
theme_manager::ThemeStaged::Current
});
tasks.push(self.drawer.update_frosted_windows(v));
}
Message::FrostedPanel(v) => {
theme_staged = self.theme_manager.set_frosted_panel(v).map(|_| {
self.drawer.reset(&self.theme_manager);
theme_manager::ThemeStaged::Current
});
tasks.push(self.drawer.update_frosted_panel(v));
}
Message::FrostedApplets(v) => {
theme_staged = self.theme_manager.set_frosted_applets(v).map(|_| {
self.drawer.reset(&self.theme_manager);
theme_manager::ThemeStaged::Current
});
tasks.push(self.drawer.update_frosted_applets(v));
}
} }
let mut tasks = cosmic::Task::batch(tasks); let mut tasks = cosmic::Task::batch(tasks);

View file

@ -5,6 +5,8 @@ use cosmic::widget::{button, container, settings, text};
use cosmic::{Apply, Element}; use cosmic::{Apply, Element};
use cosmic_settings_page::Section; use cosmic_settings_page::Section;
use crate::pages::desktop::appearance::ContextView;
use super::{Message, Page, Roundness}; use super::{Message, Page, Roundness};
#[allow(clippy::too_many_lines)] #[allow(clippy::too_many_lines)]
@ -13,6 +15,7 @@ pub fn section() -> Section<crate::pages::Message> {
round = fl!("style", "round"); round = fl!("style", "round");
slightly_round = fl!("style", "slightly-round"); slightly_round = fl!("style", "slightly-round");
square = fl!("style", "square"); square = fl!("style", "square");
frosted_glass = fl!("style", "frosted-glass");
}); });
let dark_round_style = from_name("illustration-appearance-dark-style-round").handle(); let dark_round_style = from_name("illustration-appearance-dark-style-round").handle();
@ -137,6 +140,10 @@ pub fn section() -> Section<crate::pages::Message> {
) )
.center_x(Length::Fill), .center_x(Length::Fill),
) )
.add(crate::widget::go_next_item(
&descriptions[frosted_glass],
Message::DrawerOpen(ContextView::FrostedGlass),
))
.apply(Element::from) .apply(Element::from)
.map(crate::pages::Message::Appearance) .map(crate::pages::Message::Appearance)
}) })

View file

@ -1,8 +1,8 @@
use cosmic::cosmic_config::{Config, ConfigSet, CosmicConfigEntry}; use cosmic::cosmic_config::{Config, ConfigSet, CosmicConfigEntry};
use cosmic::cosmic_theme::palette::{Srgb, Srgba}; use cosmic::cosmic_theme::palette::{Srgb, Srgba};
use cosmic::cosmic_theme::{ use cosmic::cosmic_theme::{
CornerRadii, DARK_THEME_BUILDER_ID, LIGHT_THEME_BUILDER_ID, Spacing, Theme, ThemeBuilder, AlphaMap, BlurStrength, CornerRadii, DARK_THEME_BUILDER_ID, LIGHT_THEME_BUILDER_ID, Spacing,
ThemeMode, Theme, ThemeBuilder, ThemeMode,
}; };
use cosmic::iced::core::Color; use cosmic::iced::core::Color;
@ -74,7 +74,7 @@ impl From<(Option<Config>, Option<Config>, Option<Vec<Srgba>>)> for ThemeCustomi
.success(theme.success.base.color) .success(theme.success.base.color)
.warning(theme.warning.base.color) .warning(theme.warning.base.color)
.neutral_tint(theme.palette.neutral_5.color) .neutral_tint(theme.palette.neutral_5.color)
.text_tint(theme.background.on.color); .text_tint(theme.background(false).on.color);
theme_builder.gaps = theme.gaps; theme_builder.gaps = theme.gaps;
@ -160,20 +160,6 @@ impl Default for Manager {
impl Manager { impl Manager {
pub fn build_theme(&mut self, stage: ThemeStaged) -> Task<app::Message> { pub fn build_theme(&mut self, stage: ThemeStaged) -> Task<app::Message> {
macro_rules! theme_transaction {
($config:ident, $current_theme:ident, $new_theme:ident, { $($name:ident;)+ }) => {
let tx = $config.transaction();
$(
if $current_theme.$name != $new_theme.$name {
_ = tx.set(stringify!($name), $new_theme.$name.clone());
}
)+
_ = tx.commit();
}
}
let map_data_fn = |customizer: &ThemeCustomizer| { let map_data_fn = |customizer: &ThemeCustomizer| {
(customizer.builder.0.clone(), customizer.theme.1.clone()) (customizer.builder.0.clone(), customizer.theme.1.clone())
}; };
@ -199,32 +185,80 @@ impl Manager {
cosmic::task::future(async move { cosmic::task::future(async move {
for (builder, config) in data.by_ref() { for (builder, config) in data.by_ref() {
if let Some(config) = config { if let Some(config) = config {
let current_theme = match Theme::get_entry(&config) { let cur = match Theme::get_entry(&config) {
Ok(theme) => theme, Ok(theme) => theme,
Err((_errs, theme)) => theme, Err((_errs, theme)) => theme,
}; };
let new_theme = builder.build(); let new = builder.build();
theme_transaction!(config, current_theme, new_theme, {
accent; // do this without the macro
accent_button; let tx = config.transaction();
background;
button; if cur.accent != new.accent {
destructive; _ = tx.set("accent", new.accent.clone());
destructive_button; }
link_button; if cur.accent_button != new.accent_button {
icon_button; _ = tx.set("accent_button", new.accent_button.clone());
palette; }
primary; if cur.background(false) != new.background(false) {
secondary; _ = tx.set("background", new.background(false).clone());
shade; }
success; if cur.background(true) != new.background(true) {
text_button; _ = tx.set("transparent_background", new.background(true).clone());
warning; }
warning_button; if cur.button != new.button {
window_hint; _ = tx.set("button", new.button.clone());
accent_text; }
}); if cur.destructive != new.destructive {
_ = tx.set("destructive", new.destructive.clone());
}
if cur.destructive_button != new.destructive_button {
_ = tx.set("destructive_button", new.destructive_button.clone());
}
if cur.link_button != new.link_button {
_ = tx.set("link_button", new.link_button.clone());
}
if cur.icon_button != new.icon_button {
_ = tx.set("icon_button", new.icon_button.clone());
}
if cur.palette != new.palette {
_ = tx.set("palette", new.palette.clone());
}
if cur.primary(false) != new.primary(false) {
_ = tx.set("primary", new.primary(false).clone());
}
if cur.secondary(false) != new.secondary(false) {
_ = tx.set("secondary", new.secondary(false).clone());
}
if cur.primary(true) != new.primary(true) {
_ = tx.set("transparent_primary", new.primary(true).clone());
}
if cur.secondary(true) != new.secondary(true) {
_ = tx.set("transparent_secondary", new.secondary(true).clone());
}
if cur.shade != new.shade {
_ = tx.set("shade", new.shade.clone());
}
if cur.success != new.success {
_ = tx.set("success", new.success.clone());
}
if cur.text_button != new.text_button {
_ = tx.set("text_button", new.text_button.clone());
}
if cur.warning != new.warning {
_ = tx.set("warning", new.warning.clone());
}
if cur.warning_button != new.warning_button {
_ = tx.set("warning_button", new.warning_button.clone());
}
if cur.window_hint != new.window_hint {
_ = tx.set("window_hint", new.window_hint.clone());
}
if cur.accent_text != new.accent_text {
_ = tx.set("accent_text", new.accent_text.clone());
}
_ = tx.commit();
} }
} }
@ -360,6 +394,39 @@ impl Manager {
Some(ThemeStaged::Both) Some(ThemeStaged::Both)
} }
pub fn set_frosted(&mut self, frosted: BlurStrength) -> Option<ThemeStaged> {
self.dark.set_frosted(frosted)?;
self.light.set_frosted(frosted)?;
Some(ThemeStaged::Both)
}
pub fn set_glass(&mut self, alpha_map: AlphaMap) -> Option<ThemeStaged> {
self.dark.set_glass(alpha_map)?;
self.light.set_glass(alpha_map)?;
Some(ThemeStaged::Both)
}
pub fn set_frosted_panel(&mut self, enabled: bool) -> Option<ThemeStaged> {
self.dark.set_frosted_panel(enabled)?;
self.light.set_frosted_panel(enabled)?;
Some(ThemeStaged::Both)
}
pub fn set_frosted_applets(&mut self, enabled: bool) -> Option<ThemeStaged> {
self.dark.set_frosted_applets(enabled)?;
self.light.set_frosted_applets(enabled)?;
Some(ThemeStaged::Both)
}
pub fn set_frosted_system_interface(&mut self, enabled: bool) -> Option<ThemeStaged> {
self.dark.set_frosted_system_interface(enabled)?;
self.light.set_frosted_system_interface(enabled)?;
Some(ThemeStaged::Both)
}
pub fn set_frosted_windows(&mut self, enabled: bool) -> Option<ThemeStaged> {
self.dark.set_frosted_windows(enabled)?;
self.light.set_frosted_windows(enabled)?;
Some(ThemeStaged::Both)
}
pub fn get_color(&self, context: &ContextView) -> Option<Color> { pub fn get_color(&self, context: &ContextView) -> Option<Color> {
match *context { match *context {
ContextView::CustomAccent => self.custom_accent().map(Color::from), ContextView::CustomAccent => self.custom_accent().map(Color::from),
@ -540,6 +607,81 @@ impl ThemeCustomizer {
Some(ThemeStaged::Current) Some(ThemeStaged::Current)
} }
pub fn set_frosted(&mut self, frosted: BlurStrength) -> Option<ThemeStaged> {
let config = self.builder.1.as_ref()?;
self.builder.0.set_frosted(config, frosted).ok()?;
self.theme
.0
.set_frosted(self.theme.1.as_ref()?, frosted)
.ok()?;
Some(ThemeStaged::Current)
}
pub fn set_glass(&mut self, alpha_map: AlphaMap) -> Option<ThemeStaged> {
let config = self.builder.1.as_ref()?;
self.builder.0.set_alpha_map(config, alpha_map).ok()?;
self.theme
.0
.set_alpha_map(self.theme.1.as_ref()?, alpha_map)
.ok()?;
Some(ThemeStaged::Current)
}
pub fn set_frosted_windows(&mut self, enabled: bool) -> Option<ThemeStaged> {
let config = self.builder.1.as_ref()?;
self.builder.0.set_frosted_windows(config, enabled).ok()?;
self.theme
.0
.set_frosted_windows(self.theme.1.as_ref()?, enabled)
.ok()?;
Some(ThemeStaged::Current)
}
pub fn set_frosted_system_interface(&mut self, enabled: bool) -> Option<ThemeStaged> {
let config = self.builder.1.as_ref()?;
self.builder
.0
.set_frosted_system_interface(config, enabled)
.ok()?;
self.theme
.0
.set_frosted_system_interface(self.theme.1.as_ref()?, enabled)
.ok()?;
Some(ThemeStaged::Current)
}
pub fn set_frosted_applets(&mut self, enabled: bool) -> Option<ThemeStaged> {
let config = self.builder.1.as_ref()?;
self.builder.0.set_frosted_applets(config, enabled).ok()?;
self.theme
.0
.set_frosted_applets(self.theme.1.as_ref()?, enabled)
.ok()?;
Some(ThemeStaged::Current)
}
pub fn set_frosted_panel(&mut self, enabled: bool) -> Option<ThemeStaged> {
let config = self.builder.1.as_ref()?;
self.builder.0.set_frosted_panel(config, enabled).ok()?;
self.theme
.0
.set_frosted_panel(self.theme.1.as_ref()?, enabled)
.ok()?;
Some(ThemeStaged::Current)
}
// set active hints is set on all themes to be consistent between dark & light themes. // set active hints is set on all themes to be consistent between dark & light themes.
pub fn set_active_hint(&mut self, active_hint: u32) -> Option<ThemeStaged> { pub fn set_active_hint(&mut self, active_hint: u32) -> Option<ThemeStaged> {
let config = self.builder.1.as_ref()?; let config = self.builder.1.as_ref()?;

View file

@ -36,7 +36,7 @@ impl Info {
// Use wgpu to enumerate GPUs. Works cross-platform and doesn't require external tools // Use wgpu to enumerate GPUs. Works cross-platform and doesn't require external tools
let instance = wgpu::Instance::default(); let instance = wgpu::Instance::default();
let adapters = instance.enumerate_adapters(wgpu::Backends::all()).await; let adapters = instance.enumerate_adapters(wgpu::Backends::all());
// Track seen GPUs by (vendor, device) and by name to handle different scenarios: // Track seen GPUs by (vendor, device) and by name to handle different scenarios:
// - Same GPU via different backends (Vulkan/OpenGL) -> deduplicate by device ID or name // - Same GPU via different backends (Vulkan/OpenGL) -> deduplicate by device ID or name
@ -45,7 +45,7 @@ impl Info {
let mut seen_devices = HashSet::new(); let mut seen_devices = HashSet::new();
let mut seen_names = HashSet::new(); let mut seen_names = HashSet::new();
for adapter in adapters { for adapter in adapters.await {
let adapter_info = adapter.get_info(); let adapter_info = adapter.get_info();
if adapter_info.device_type == wgpu::DeviceType::Cpu { if adapter_info.device_type == wgpu::DeviceType::Cpu {

View file

@ -401,6 +401,19 @@ style = Style
.round = Round .round = Round
.slightly-round = Slightly round .slightly-round = Slightly round
.square = Square .square = Square
.frosted-glass = Frosted glass
.frosted-system-interface = System interface
.frosted-system-interface-desc = Applies frosted glass to Launcher, application library, workspace overview, on-screen controls
.frosted-windows = Windows
.frosted-windows-desc = Applies frosted glass to windows and dialogs
.frosted-panels = Panels
.frosted-panels-desc = Applies frosted glass to panel and dock
.frosted-applets = Applets
.frosted-applets-desc = Applies frosted glass to applet menus on panel and dock
.frosted-thickness = Frost thickness
.less = less
.more = more
.glass-opacity = Glass opacity
interface-density = Interface density interface-density = Interface density
.comfortable = Comfortable .comfortable = Comfortable

View file

@ -0,0 +1,16 @@
(
extremely_low: 0.9,
extremely_low_2: 0.87692,
very_low: 0.85385,
very_low_2: 0.83076,
low: 0.80769,
low_2: 0.78461,
medium: 0.76154,
medium_2: 0.73846,
high: 0.71538,
high_2: 0.69231,
very_high: 0.66023,
very_high_2: 0.64615,
extremely_high: 0.62308,
extremely_high_2: 0.6,
)

View file

@ -0,0 +1,8 @@
(
radius_0: (0.0, 0.0, 0.0, 0.0),
radius_xs: (4.0, 4.0, 4.0, 4.0),
radius_s: (8.0, 8.0, 8.0, 8.0),
radius_m: (16.0, 16.0, 16.0, 16.0),
radius_l: (32.0, 32.0, 32.0, 32.0),
radius_xl: (160.0, 160.0, 160.0, 160.0),
)

View file

@ -0,0 +1 @@
(0, 8)

View file

@ -0,0 +1,35 @@
(
name: "cosmic-dark",
bright_red: "#FFA09AFF",
bright_green: "#5EDB8CFF",
bright_orange: "#FFA37DFF",
gray_1: "#1B1B1BFF",
gray_2: "#262626FF",
neutral_0: "#000000FF",
neutral_1: "#030303FF",
neutral_2: "#161616FF",
neutral_3: "#2E2E2EFF",
neutral_4: "#484848FF",
neutral_5: "#636363FF",
neutral_6: "#808080FF",
neutral_7: "#9E9E9EFF",
neutral_8: "#BEBEBEFF",
neutral_9: "#DEDEDEFF",
neutral_10: "#FFFFFFFF",
accent_blue: "#63D0DFFF",
accent_indigo: "#A1C0EBFF",
accent_purple: "#E79CFEFF",
accent_pink: "#FF9CB1FF",
accent_red: "#FDA1A0FF",
accent_orange: "#FFAD00FF",
accent_yellow: "#F7E062FF",
accent_green: "#92CF9CFF",
accent_warm_grey: "#CABAB4FF",
ext_warm_grey: "#9B8E8AFF",
ext_orange: "#FFAD00FF",
ext_yellow: "#FEDB40FF",
ext_blue: "#48B9C7FF",
ext_purple: "#CF7DFFFF",
ext_pink: "#F93A83FF",
ext_indigo: "#3E88FFFF",
)

View file

@ -0,0 +1,12 @@
(
space_none: 0,
space_xxxs: 4,
space_xxs: 8,
space_xs: 12,
space_s: 16,
space_m: 24,
space_l: 32,
space_xl: 48,
space_xxl: 64,
space_xxxl: 128,
)

View file

@ -0,0 +1,14 @@
(
base: "#63D0DFFF",
hover: "#63BAC6FF",
pressed: "#3C737AFF",
selected: "#63BAC6FF",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#000000FF",
on: "#000000FF",
disabled: "#63D0DFFF",
on_disabled: "#326870FF",
border: "#63D0DFFF",
disabled_border: "#63D0DF80",
)

View file

@ -0,0 +1,14 @@
(
base: "#63D0DFFF",
hover: "#63BAC6FF",
pressed: "#3C737AFF",
selected: "#63BAC6FF",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#030303FF",
on: "#000000FF",
disabled: "#63D0DFFF",
on_disabled: "#00000080",
border: "#63D0DFFF",
disabled_border: "#63D0DF80",
)

View file

@ -0,0 +1,16 @@
(
extremely_low: 0.9,
extremely_low_2: 0.87692,
very_low: 0.85385,
very_low_2: 0.83076,
low: 0.80769,
low_2: 0.78461,
medium: 0.76154,
medium_2: 0.73846,
high: 0.71538,
high_2: 0.69231,
very_high: 0.66023,
very_high_2: 0.64615,
extremely_high: 0.62308,
extremely_high_2: 0.6,
)

View file

@ -0,0 +1,20 @@
(
base: "#1B1B1BFF",
component: (
base: "#2E2E2EFF",
hover: "#434343FF",
pressed: "#585858FF",
selected: "#434343FF",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#C0C0C033",
on: "#C0C0C0FF",
disabled: "#2E2E2E80",
on_disabled: "#C0C0C0A6",
border: "#BEBEBEFF",
disabled_border: "#BEBEBE80",
),
divider: "#444444FF",
on: "#E7E7E7FF",
small_widget: "#27272740",
)

View file

@ -0,0 +1,14 @@
(
base: "#9E9E9E40",
hover: "#63636366",
pressed: "#2B2B2B9F",
selected: "#63636366",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#C0C0C033",
on: "#C0C0C0FF",
disabled: "#9E9E9E20",
on_disabled: "#C0C0C0A6",
border: "#BEBEBEFF",
disabled_border: "#BEBEBE80",
)

View file

@ -0,0 +1,8 @@
(
radius_0: (0.0, 0.0, 0.0, 0.0),
radius_xs: (4.0, 4.0, 4.0, 4.0),
radius_s: (8.0, 8.0, 8.0, 8.0),
radius_m: (16.0, 16.0, 16.0, 16.0),
radius_l: (32.0, 32.0, 32.0, 32.0),
radius_xl: (160.0, 160.0, 160.0, 160.0),
)

View file

@ -0,0 +1,14 @@
(
base: "#FFA09AFF",
hover: "#E0948FFF",
pressed: "#8A5B58FF",
selected: "#E0948FFF",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#000000FF",
on: "#000000FF",
disabled: "#FFA09AFF",
on_disabled: "#80504DFF",
border: "#FFA09AFF",
disabled_border: "#FFA09A80",
)

View file

@ -0,0 +1,14 @@
(
base: "#FFA09AFF",
hover: "#E0948FFF",
pressed: "#8A5B58FF",
selected: "#E0948FFF",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#030303FF",
on: "#000000FF",
disabled: "#FFA09AFF",
on_disabled: "#00000080",
border: "#FFA09AFF",
disabled_border: "#FFA09A80",
)

View file

@ -0,0 +1 @@
Medium

View file

@ -0,0 +1 @@
(0, 8)

View file

@ -0,0 +1,14 @@
(
base: "#00000000",
hover: "#63636333",
pressed: "#16161680",
selected: "#63636333",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#BEBEBE33",
on: "#BEBEBEFF",
disabled: "#00000000",
on_disabled: "#BEBEBEA6",
border: "#BEBEBEFF",
disabled_border: "#BEBEBE80",
)

View file

@ -0,0 +1 @@
true

View file

@ -0,0 +1,14 @@
(
base: "#00000000",
hover: "#00000000",
pressed: "#00000000",
selected: "#00000000",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#63D0DF33",
on: "#63D0DFFF",
disabled: "#00000000",
on_disabled: "#32687080",
border: "#BEBEBEFF",
disabled_border: "#BEBEBE80",
)

View file

@ -0,0 +1 @@
"cosmic-dark"

View file

@ -0,0 +1,35 @@
(
name: "cosmic-dark",
bright_red: "#FFA09AFF",
bright_green: "#5EDB8CFF",
bright_orange: "#FFA37DFF",
gray_1: "#1B1B1BFF",
gray_2: "#262626FF",
neutral_0: "#000000FF",
neutral_1: "#030303FF",
neutral_2: "#161616FF",
neutral_3: "#2E2E2EFF",
neutral_4: "#484848FF",
neutral_5: "#636363FF",
neutral_6: "#808080FF",
neutral_7: "#9E9E9EFF",
neutral_8: "#BEBEBEFF",
neutral_9: "#DEDEDEFF",
neutral_10: "#FFFFFFFF",
accent_blue: "#63D0DFFF",
accent_indigo: "#A1C0EBFF",
accent_purple: "#E79CFEFF",
accent_pink: "#FF9CB1FF",
accent_red: "#FDA1A0FF",
accent_orange: "#FFAD00FF",
accent_yellow: "#F7E062FF",
accent_green: "#92CF9CFF",
accent_warm_grey: "#CABAB4FF",
ext_warm_grey: "#9B8E8AFF",
ext_orange: "#FFAD00FF",
ext_yellow: "#FEDB40FF",
ext_blue: "#48B9C7FF",
ext_purple: "#CF7DFFFF",
ext_pink: "#F93A83FF",
ext_indigo: "#3E88FFFF",
)

View file

@ -0,0 +1,20 @@
(
base: "#272727FF",
component: (
base: "#363636FF",
hover: "#4A4A4AFF",
pressed: "#5E5E5EFF",
selected: "#4A4A4AFF",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#CACACA33",
on: "#CACACAFF",
disabled: "#36363680",
on_disabled: "#CACACAA6",
border: "#BEBEBEFF",
disabled_border: "#BEBEBE80",
),
divider: "#515151FF",
on: "#F8F8F8FF",
small_widget: "#34343440",
)

View file

@ -0,0 +1,20 @@
(
base: "#343434FF",
component: (
base: "#3B3B3BFF",
hover: "#4F4F4FFF",
pressed: "#626262FF",
selected: "#4F4F4FFF",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#D0D0D033",
on: "#D0D0D0FF",
disabled: "#3B3B3B80",
on_disabled: "#D0D0D0A6",
border: "#BEBEBEFF",
disabled_border: "#BEBEBE80",
),
divider: "#515151FF",
on: "#C7C7C7FF",
small_widget: "#41414140",
)

View file

@ -0,0 +1 @@
"#00000052"

View file

@ -0,0 +1,12 @@
(
space_none: 0,
space_xxxs: 4,
space_xxs: 8,
space_xs: 12,
space_s: 16,
space_m: 24,
space_l: 32,
space_xl: 48,
space_xxl: 64,
space_xxxl: 128,
)

View file

@ -0,0 +1,14 @@
(
base: "#5EDB8CFF",
hover: "#5FC384FF",
pressed: "#3A7851FF",
selected: "#5FC384FF",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#000000FF",
on: "#000000FF",
disabled: "#5EDB8CFF",
on_disabled: "#2F6E46FF",
border: "#5EDB8CFF",
disabled_border: "#5EDB8C80",
)

View file

@ -0,0 +1,14 @@
(
base: "#5EDB8CFF",
hover: "#5FC384FF",
pressed: "#3A7851FF",
selected: "#5FC384FF",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#030303FF",
on: "#000000FF",
disabled: "#5EDB8CFF",
on_disabled: "#00000080",
border: "#5EDB8CFF",
disabled_border: "#5EDB8C80",
)

View file

@ -0,0 +1,14 @@
(
base: "#00000000",
hover: "#63636333",
pressed: "#16161680",
selected: "#63636333",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#63D0DF33",
on: "#63D0DFFF",
disabled: "#00000000",
on_disabled: "#63D0DFA6",
border: "#BEBEBEFF",
disabled_border: "#BEBEBE80",
)

View file

@ -0,0 +1 @@
None

View file

@ -0,0 +1,20 @@
(
base: "#1B1B1B99",
component: (
base: "#2E2E2E99",
hover: "#2E2E2E99",
pressed: "#2E2E2E99",
selected: "#2E2E2E99",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#C0C0C033",
on: "#C0C0C099",
disabled: "#2E2E2E4C",
on_disabled: "#C0C0C0A6",
border: "#BEBEBEFF",
disabled_border: "#BEBEBE80",
),
divider: "#414141AD",
on: "#E7E7E799",
small_widget: "#27272740",
)

View file

@ -0,0 +1,20 @@
(
base: "#272727E6",
component: (
base: "#363636E6",
hover: "#363636E6",
pressed: "#363636E6",
selected: "#363636E6",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#CACACA33",
on: "#CACACAE6",
disabled: "#36363673",
on_disabled: "#CACACAA6",
border: "#BEBEBEFF",
disabled_border: "#BEBEBE80",
),
divider: "#505050EB",
on: "#F8F8F8E6",
small_widget: "#34343440",
)

View file

@ -0,0 +1,20 @@
(
base: "#343434FF",
component: (
base: "#3B3B3BFF",
hover: "#3B3B3BFF",
pressed: "#3B3B3BFF",
selected: "#3B3B3BFF",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#D0D0D033",
on: "#D0D0D0FF",
disabled: "#3B3B3B80",
on_disabled: "#D0D0D0A6",
border: "#BEBEBEFF",
disabled_border: "#BEBEBE80",
),
divider: "#515151FF",
on: "#C7C7C7FF",
small_widget: "#41414140",
)

View file

@ -0,0 +1,14 @@
(
base: "#FFA37DFF",
hover: "#E09678FF",
pressed: "#8A5C49FF",
selected: "#E09678FF",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#000000FF",
on: "#000000FF",
disabled: "#FFA37DFF",
on_disabled: "#80523FFF",
border: "#FFA37DFF",
disabled_border: "#FFA37D80",
)

View file

@ -0,0 +1,14 @@
(
base: "#FFA37DFF",
hover: "#E09678FF",
pressed: "#8A5C49FF",
selected: "#E09678FF",
selected_text: "#63D0DFFF",
focus: "#63D0DFFF",
divider: "#FFFFFFFF",
on: "#000000FF",
disabled: "#FFA37DFF",
on_disabled: "#00000080",
border: "#FFA37DFF",
disabled_border: "#FFA37D80",
)

View file

@ -0,0 +1,16 @@
(
extremely_low: 0.9,
extremely_low_2: 0.87692,
very_low: 0.85385,
very_low_2: 0.83076,
low: 0.80769,
low_2: 0.78461,
medium: 0.76154,
medium_2: 0.73846,
high: 0.71538,
high_2: 0.69231,
very_high: 0.66023,
very_high_2: 0.64615,
extremely_high: 0.62308,
extremely_high_2: 0.6,
)

View file

@ -0,0 +1,8 @@
(
radius_0: (0.0, 0.0, 0.0, 0.0),
radius_xs: (4.0, 4.0, 4.0, 4.0),
radius_s: (8.0, 8.0, 8.0, 8.0),
radius_m: (16.0, 16.0, 16.0, 16.0),
radius_l: (32.0, 32.0, 32.0, 32.0),
radius_xl: (160.0, 160.0, 160.0, 160.0),
)

View file

@ -0,0 +1,35 @@
Light((
name: "cosmic-light",
bright_red: "#890418FF",
bright_green: "#00572CFF",
bright_orange: "#792C00FF",
gray_1: "#D7D7D7FF",
gray_2: "#E4E4E4FF",
neutral_0: "#FFFFFFFF",
neutral_1: "#DEDEDEFF",
neutral_2: "#BEBEBEFF",
neutral_3: "#9E9E9EFF",
neutral_4: "#808080FF",
neutral_5: "#636363FF",
neutral_6: "#484848FF",
neutral_7: "#2E2E2EFF",
neutral_8: "#161616FF",
neutral_9: "#030303FF",
neutral_10: "#000000FF",
accent_blue: "#00525AFF",
accent_indigo: "#2E496DFF",
accent_purple: "#68217CFF",
accent_pink: "#86043AFF",
accent_red: "#78292EFF",
accent_orange: "#624000FF",
accent_yellow: "#534800FF",
accent_green: "#185529FF",
accent_warm_grey: "#554742FF",
ext_warm_grey: "#9B8E8AFF",
ext_orange: "#FBB86CFF",
ext_yellow: "#F7E062FF",
ext_blue: "#6ACAD8FF",
ext_purple: "#D58CFFFF",
ext_pink: "#FF9CDDFF",
ext_indigo: "#95C4FCFF",
))

View file

@ -0,0 +1,12 @@
(
space_none: 0,
space_xxxs: 4,
space_xxs: 8,
space_xs: 12,
space_s: 16,
space_m: 24,
space_l: 32,
space_xl: 48,
space_xxl: 64,
space_xxxl: 128,
)

View file

@ -0,0 +1,14 @@
(
base: "#00525AFF",
hover: "#14555CFF",
pressed: "#5F888CFF",
selected: "#14555CFF",
selected_text: "#00525AFF",
focus: "#00525AFF",
divider: "#FFFFFFFF",
on: "#FFFFFFFF",
disabled: "#00525AFF",
on_disabled: "#7FA8ACFF",
border: "#00525AFF",
disabled_border: "#00525A80",
)

View file

@ -0,0 +1,14 @@
(
base: "#00525AFF",
hover: "#14555CFF",
pressed: "#5F888CFF",
selected: "#14555CFF",
selected_text: "#00525AFF",
focus: "#00525AFF",
divider: "#DEDEDEFF",
on: "#FFFFFFFF",
disabled: "#00525AFF",
on_disabled: "#FFFFFF80",
border: "#00525AFF",
disabled_border: "#00525A80",
)

View file

@ -0,0 +1,16 @@
(
extremely_low: 0.9,
extremely_low_2: 0.87692,
very_low: 0.85385,
very_low_2: 0.83076,
low: 0.80769,
low_2: 0.78461,
medium: 0.76154,
medium_2: 0.73846,
high: 0.71538,
high_2: 0.69231,
very_high: 0.66023,
very_high_2: 0.64615,
extremely_high: 0.62308,
extremely_high_2: 0.6,
)

View file

@ -0,0 +1,20 @@
(
base: "#D7D7D7FF",
component: (
base: "#F5F5F5FF",
hover: "#F6F6F6FF",
pressed: "#F7F7F7FF",
selected: "#F6F6F6FF",
selected_text: "#00525AFF",
focus: "#00525AFF",
divider: "#27272733",
on: "#272727FF",
disabled: "#F5F5F580",
on_disabled: "#272727A6",
border: "#161616FF",
disabled_border: "#16161680",
),
divider: "#B0B0B0FF",
on: "#121212FF",
small_widget: "#CACACA40",
)

View file

@ -0,0 +1,14 @@
(
base: "#2E2E2E40",
hover: "#2B2B2B66",
pressed: "#6868689F",
selected: "#2B2B2B66",
selected_text: "#00525AFF",
focus: "#00525AFF",
divider: "#27272733",
on: "#272727FF",
disabled: "#2E2E2E20",
on_disabled: "#272727A6",
border: "#161616FF",
disabled_border: "#16161680",
)

View file

@ -0,0 +1,8 @@
(
radius_0: (0.0, 0.0, 0.0, 0.0),
radius_xs: (4.0, 4.0, 4.0, 4.0),
radius_s: (8.0, 8.0, 8.0, 8.0),
radius_m: (16.0, 16.0, 16.0, 16.0),
radius_l: (32.0, 32.0, 32.0, 32.0),
radius_xl: (160.0, 160.0, 160.0, 160.0),
)

View file

@ -0,0 +1,14 @@
(
base: "#890418FF",
hover: "#811727FF",
pressed: "#A3616BFF",
selected: "#811727FF",
selected_text: "#00525AFF",
focus: "#00525AFF",
divider: "#FFFFFFFF",
on: "#FFFFFFFF",
disabled: "#890418FF",
on_disabled: "#C4828CFF",
border: "#890418FF",
disabled_border: "#89041880",
)

View file

@ -0,0 +1,14 @@
(
base: "#890418FF",
hover: "#811727FF",
pressed: "#A3616BFF",
selected: "#811727FF",
selected_text: "#00525AFF",
focus: "#00525AFF",
divider: "#DEDEDEFF",
on: "#FFFFFFFF",
disabled: "#890418FF",
on_disabled: "#FFFFFF80",
border: "#890418FF",
disabled_border: "#89041880",
)

View file

@ -0,0 +1 @@
Medium

Some files were not shown because too many files have changed in this diff Show more