feat: blur

This commit is contained in:
Ashley Wulber 2026-07-01 22:57:58 -04:00
parent b162e335db
commit 54ed6b0a93
3 changed files with 75 additions and 42 deletions

92
Cargo.lock generated
View file

@ -1061,7 +1061,7 @@ dependencies = [
[[package]] [[package]]
name = "cosmic-client-toolkit" name = "cosmic-client-toolkit"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1#c253ec1d6804afbcdf250f5cc37ae1194bba7bd2" source = "git+https://github.com/pop-os/cosmic-protocols?rev=32283d7#32283d76a8d0342da74c4cc022a533c52dcf378f"
dependencies = [ dependencies = [
"bitflags 2.13.0", "bitflags 2.13.0",
"cosmic-protocols", "cosmic-protocols",
@ -1074,7 +1074,7 @@ dependencies = [
[[package]] [[package]]
name = "cosmic-config" name = "cosmic-config"
version = "1.0.0" version = "1.0.0"
source = "git+https://github.com/pop-os/libcosmic.git#18a7a75e3316b1f4855777af677d989467f2da74" source = "git+https://github.com/pop-os/libcosmic.git#20dfd7c236208930634881ec52d22e7a353206dd"
dependencies = [ dependencies = [
"atomicwrites", "atomicwrites",
"cosmic-config-derive", "cosmic-config-derive",
@ -1095,7 +1095,7 @@ dependencies = [
[[package]] [[package]]
name = "cosmic-config-derive" name = "cosmic-config-derive"
version = "1.0.0" version = "1.0.0"
source = "git+https://github.com/pop-os/libcosmic.git#18a7a75e3316b1f4855777af677d989467f2da74" source = "git+https://github.com/pop-os/libcosmic.git#20dfd7c236208930634881ec52d22e7a353206dd"
dependencies = [ dependencies = [
"quote", "quote",
"syn", "syn",
@ -1145,7 +1145,7 @@ dependencies = [
[[package]] [[package]]
name = "cosmic-protocols" name = "cosmic-protocols"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/pop-os/cosmic-protocols?rev=c253ec1#c253ec1d6804afbcdf250f5cc37ae1194bba7bd2" source = "git+https://github.com/pop-os/cosmic-protocols?rev=32283d7#32283d76a8d0342da74c4cc022a533c52dcf378f"
dependencies = [ dependencies = [
"bitflags 2.13.0", "bitflags 2.13.0",
"wayland-backend", "wayland-backend",
@ -1191,13 +1191,14 @@ dependencies = [
[[package]] [[package]]
name = "cosmic-theme" name = "cosmic-theme"
version = "1.0.0" version = "1.0.0"
source = "git+https://github.com/pop-os/libcosmic.git#18a7a75e3316b1f4855777af677d989467f2da74" source = "git+https://github.com/pop-os/libcosmic.git#20dfd7c236208930634881ec52d22e7a353206dd"
dependencies = [ dependencies = [
"almost", "almost",
"configparser", "configparser",
"cosmic-config", "cosmic-config",
"csscolorparser", "csscolorparser",
"dirs", "dirs",
"hex_color",
"palette", "palette",
"ron", "ron",
"serde", "serde",
@ -2542,6 +2543,17 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "hex_color"
version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d37f101bf4c633f7ca2e4b5e136050314503dd198e78e325ea602c327c484ef0"
dependencies = [
"arrayvec",
"rand 0.8.6",
"serde",
]
[[package]] [[package]]
name = "hexf-parse" name = "hexf-parse"
version = "0.2.1" version = "0.2.1"
@ -2627,7 +2639,7 @@ dependencies = [
[[package]] [[package]]
name = "iced" name = "iced"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic.git#18a7a75e3316b1f4855777af677d989467f2da74" source = "git+https://github.com/pop-os/libcosmic.git#20dfd7c236208930634881ec52d22e7a353206dd"
dependencies = [ dependencies = [
"dnd", "dnd",
"iced_accessibility", "iced_accessibility",
@ -2648,7 +2660,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_accessibility" name = "iced_accessibility"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/pop-os/libcosmic.git#18a7a75e3316b1f4855777af677d989467f2da74" source = "git+https://github.com/pop-os/libcosmic.git#20dfd7c236208930634881ec52d22e7a353206dd"
dependencies = [ dependencies = [
"accesskit", "accesskit",
"accesskit_winit", "accesskit_winit",
@ -2657,7 +2669,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_core" name = "iced_core"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic.git#18a7a75e3316b1f4855777af677d989467f2da74" source = "git+https://github.com/pop-os/libcosmic.git#20dfd7c236208930634881ec52d22e7a353206dd"
dependencies = [ dependencies = [
"bitflags 2.13.0", "bitflags 2.13.0",
"bytes", "bytes",
@ -2682,7 +2694,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_debug" name = "iced_debug"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic.git#18a7a75e3316b1f4855777af677d989467f2da74" source = "git+https://github.com/pop-os/libcosmic.git#20dfd7c236208930634881ec52d22e7a353206dd"
dependencies = [ dependencies = [
"iced_core", "iced_core",
"iced_futures", "iced_futures",
@ -2692,7 +2704,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_futures" name = "iced_futures"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic.git#18a7a75e3316b1f4855777af677d989467f2da74" source = "git+https://github.com/pop-os/libcosmic.git#20dfd7c236208930634881ec52d22e7a353206dd"
dependencies = [ dependencies = [
"futures", "futures",
"iced_core", "iced_core",
@ -2706,7 +2718,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_graphics" name = "iced_graphics"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic.git#18a7a75e3316b1f4855777af677d989467f2da74" source = "git+https://github.com/pop-os/libcosmic.git#20dfd7c236208930634881ec52d22e7a353206dd"
dependencies = [ dependencies = [
"bitflags 2.13.0", "bitflags 2.13.0",
"bytemuck", "bytemuck",
@ -2727,7 +2739,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_program" name = "iced_program"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic.git#18a7a75e3316b1f4855777af677d989467f2da74" source = "git+https://github.com/pop-os/libcosmic.git#20dfd7c236208930634881ec52d22e7a353206dd"
dependencies = [ dependencies = [
"iced_graphics", "iced_graphics",
"iced_runtime", "iced_runtime",
@ -2736,7 +2748,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_renderer" name = "iced_renderer"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic.git#18a7a75e3316b1f4855777af677d989467f2da74" source = "git+https://github.com/pop-os/libcosmic.git#20dfd7c236208930634881ec52d22e7a353206dd"
dependencies = [ dependencies = [
"iced_graphics", "iced_graphics",
"iced_tiny_skia", "iced_tiny_skia",
@ -2748,7 +2760,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_runtime" name = "iced_runtime"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic.git#18a7a75e3316b1f4855777af677d989467f2da74" source = "git+https://github.com/pop-os/libcosmic.git#20dfd7c236208930634881ec52d22e7a353206dd"
dependencies = [ dependencies = [
"bytes", "bytes",
"cosmic-client-toolkit", "cosmic-client-toolkit",
@ -2763,7 +2775,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_tiny_skia" name = "iced_tiny_skia"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic.git#18a7a75e3316b1f4855777af677d989467f2da74" source = "git+https://github.com/pop-os/libcosmic.git#20dfd7c236208930634881ec52d22e7a353206dd"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
"cosmic-text", "cosmic-text",
@ -2798,7 +2810,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_wgpu" name = "iced_wgpu"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic.git#18a7a75e3316b1f4855777af677d989467f2da74" source = "git+https://github.com/pop-os/libcosmic.git#20dfd7c236208930634881ec52d22e7a353206dd"
dependencies = [ dependencies = [
"as-raw-xcb-connection", "as-raw-xcb-connection",
"bitflags 2.13.0", "bitflags 2.13.0",
@ -2829,7 +2841,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_widget" name = "iced_widget"
version = "0.14.2" version = "0.14.2"
source = "git+https://github.com/pop-os/libcosmic.git#18a7a75e3316b1f4855777af677d989467f2da74" source = "git+https://github.com/pop-os/libcosmic.git#20dfd7c236208930634881ec52d22e7a353206dd"
dependencies = [ dependencies = [
"cosmic-client-toolkit", "cosmic-client-toolkit",
"dnd", "dnd",
@ -2847,7 +2859,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_winit" name = "iced_winit"
version = "0.14.0" version = "0.14.0"
source = "git+https://github.com/pop-os/libcosmic.git#18a7a75e3316b1f4855777af677d989467f2da74" source = "git+https://github.com/pop-os/libcosmic.git#20dfd7c236208930634881ec52d22e7a353206dd"
dependencies = [ dependencies = [
"cosmic-client-toolkit", "cosmic-client-toolkit",
"cursor-icon", "cursor-icon",
@ -3106,9 +3118,9 @@ dependencies = [
[[package]] [[package]]
name = "inotify-sys" name = "inotify-sys"
version = "0.1.5" version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" checksum = "6fda9741ca16536952da2ecaa6105c2f4653fa6f0724681df6d2414c4106d0b0"
dependencies = [ dependencies = [
"libc", "libc",
] ]
@ -3404,7 +3416,7 @@ checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
[[package]] [[package]]
name = "libcosmic" name = "libcosmic"
version = "1.0.0" version = "1.0.0"
source = "git+https://github.com/pop-os/libcosmic.git#18a7a75e3316b1f4855777af677d989467f2da74" source = "git+https://github.com/pop-os/libcosmic.git#20dfd7c236208930634881ec52d22e7a353206dd"
dependencies = [ dependencies = [
"apply", "apply",
"ashpd 0.12.3", "ashpd 0.12.3",
@ -3416,6 +3428,7 @@ dependencies = [
"cosmic-theme", "cosmic-theme",
"css-color", "css-color",
"derive_setters", "derive_setters",
"enumflags2",
"float-cmp 0.10.0", "float-cmp 0.10.0",
"futures", "futures",
"i18n-embed", "i18n-embed",
@ -3475,14 +3488,14 @@ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
[[package]] [[package]]
name = "libredox" name = "libredox"
version = "0.1.17" version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f02ab6bace2054fb888a3c16f990117b579d14a3088e472d63c6011fa185c9d3" checksum = "c943259e342f1e06ff2da7a83eabdfe7f92ce10262688dbf1895ff0b3e6e4652"
dependencies = [ dependencies = [
"bitflags 2.13.0", "bitflags 2.13.0",
"libc", "libc",
"plain", "plain",
"redox_syscall 0.8.1", "redox_syscall 0.9.0",
] ]
[[package]] [[package]]
@ -4691,6 +4704,8 @@ version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a"
dependencies = [ dependencies = [
"libc",
"rand_chacha 0.3.1",
"rand_core 0.6.4", "rand_core 0.6.4",
] ]
@ -4700,10 +4715,20 @@ version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea"
dependencies = [ dependencies = [
"rand_chacha", "rand_chacha 0.9.0",
"rand_core 0.9.5", "rand_core 0.9.5",
] ]
[[package]]
name = "rand_chacha"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
dependencies = [
"ppv-lite86",
"rand_core 0.6.4",
]
[[package]] [[package]]
name = "rand_chacha" name = "rand_chacha"
version = "0.9.0" version = "0.9.0"
@ -4719,6 +4744,9 @@ name = "rand_core"
version = "0.6.4" version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
dependencies = [
"getrandom 0.2.17",
]
[[package]] [[package]]
name = "rand_core" name = "rand_core"
@ -4769,7 +4797,7 @@ dependencies = [
"paste", "paste",
"profiling", "profiling",
"rand 0.9.4", "rand 0.9.4",
"rand_chacha", "rand_chacha 0.9.0",
"simd_helpers", "simd_helpers",
"thiserror 2.0.18", "thiserror 2.0.18",
"v_frame", "v_frame",
@ -4840,9 +4868,9 @@ dependencies = [
[[package]] [[package]]
name = "redox_event" name = "redox_event"
version = "0.4.7" version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c07d0d6d291e3a951bd847b1cd4af32fc6243d64116cf7702838c02797688b7" checksum = "c5018d583d6d2f5499352aea8d177e9067d1eb03ab17c78169d5ba7a30001b15"
dependencies = [ dependencies = [
"bitflags 2.13.0", "bitflags 2.13.0",
"libredox", "libredox",
@ -4859,9 +4887,9 @@ dependencies = [
[[package]] [[package]]
name = "redox_syscall" name = "redox_syscall"
version = "0.8.1" version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b44b894f2a6e36457d665d1e08c3866add6ed5e70050c1b4ba8a8ddedb02ce7" checksum = "c5102a6aaa05aa011a238e178e6bca86d2cb56fc9f586d37cb80f5bca6e07759"
dependencies = [ dependencies = [
"bitflags 2.13.0", "bitflags 2.13.0",
] ]
@ -5605,9 +5633,9 @@ dependencies = [
[[package]] [[package]]
name = "time" name = "time"
version = "0.3.52" version = "0.3.53"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e48db7b415311b615f910b3dcaa4557bcd4bf1982379c95c223fd8c2a20e210" checksum = "18dfaaeddcb932337b5e7866ee7d0ce9b76d2fd092997146f187ec09b4558a50"
dependencies = [ dependencies = [
"deranged", "deranged",
"libc", "libc",

View file

@ -66,6 +66,9 @@ debug = true
# libcosmic = { path = "../libcosmic" } # libcosmic = { path = "../libcosmic" }
# cosmic-config = { path = "../libcosmic/cosmic-config" } # cosmic-config = { path = "../libcosmic/cosmic-config" }
# cosmic-theme = { path = "../libcosmic/cosmic-theme" } # cosmic-theme = { path = "../libcosmic/cosmic-theme" }
# libcosmic = { git = "https://github.com/pop-os/libcosmic//", branch = "iced-rebase" } # libcosmic = { git = "https://github.com/pop-os/libcosmic//", branch = "theme-v2" }
# cosmic-config = { git = "https://github.com/pop-os/libcosmic//", branch = "iced-rebase" } # cosmic-config = { git = "https://github.com/pop-os/libcosmic//", branch = "theme-v2" }
# cosmic-theme = { git = "https://github.com/pop-os/libcosmic//", branch = "iced-rebase" } # cosmic-theme = { git = "https://github.com/pop-os/libcosmic//", branch = "theme-v2" }
# iced_core = { git = "https://github.com/pop-os/libcosmic//", branch = "theme-v2" }
# iced_wgpu = { git = "https://github.com/pop-os/libcosmic//", branch = "theme-v2" }
# iced_renderer = { git = "https://github.com/pop-os/libcosmic//", branch = "theme-v2" }

View file

@ -893,6 +893,7 @@ impl Application for App {
/// Creates the application, and optionally emits command on initialize. /// Creates the application, and optionally emits command on initialize.
fn init(mut core: Core, flags: Self::Flags) -> (Self, Task<Self::Message>) { fn init(mut core: Core, flags: Self::Flags) -> (Self, Task<Self::Message>) {
core.window.content_container = false; core.window.content_container = false;
core.window.transparent_header = true;
#[cfg(feature = "xdg-portal")] #[cfg(feature = "xdg-portal")]
let inhibit = { let inhibit = {
@ -1034,11 +1035,12 @@ impl Application for App {
// This ensures we have a solid background color even when using no content container // This ensures we have a solid background color even when using no content container
let theme = self.core.system_theme(); let theme = self.core.system_theme();
let bg = theme.cosmic().background(theme.transparent);
Some(cosmic::iced::core::theme::Style { Some(cosmic::iced::core::theme::Style {
background_color: theme.cosmic().bg_color().into(), background_color: bg.base.into(),
icon_color: theme.cosmic().on_bg_color().into(), icon_color: bg.on.into(),
text_color: theme.cosmic().on_bg_color().into(), text_color: bg.on.into(),
}) })
} }
@ -1706,7 +1708,6 @@ impl Application for App {
return widget::container(column) return widget::container(column)
.width(Length::Fill) .width(Length::Fill)
.height(Length::Fill) .height(Length::Fill)
.class(theme::Container::WindowBackground)
.into(); .into();
}; };
@ -1727,8 +1728,9 @@ impl Application for App {
let mut background_color = Color::BLACK; let mut background_color = Color::BLACK;
let mut text_color_opt = None; let mut text_color_opt = None;
if !video.has_video() { if !video.has_video() {
background_color = theme.cosmic().bg_component_color().into(); let bg = theme.cosmic().background(theme.transparent);
text_color_opt = Some(Color::from(theme.cosmic().on_bg_component_color())); background_color = bg.base.into();
text_color_opt = Some(Color::from(bg.on));
let mut col = widget::column::with_capacity(10); let mut col = widget::column::with_capacity(10);
col = col.push(widget::space::vertical()); col = col.push(widget::space::vertical());
@ -1920,7 +1922,7 @@ impl Application for App {
//TODO: move style to libcosmic //TODO: move style to libcosmic
.class(theme::Container::custom(|theme| { .class(theme::Container::custom(|theme| {
let cosmic = theme.cosmic(); let cosmic = theme.cosmic();
let component = &cosmic.background.component; let component = &cosmic.background(theme.transparent).component;
widget::container::Style { widget::container::Style {
icon_color: Some(component.on.into()), icon_color: Some(component.on.into()),
text_color: Some(component.on.into()), text_color: Some(component.on.into()),