diff --git a/Cargo.lock b/Cargo.lock index 20b462a..c587a9f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1061,7 +1061,7 @@ dependencies = [ [[package]] name = "cosmic-client-toolkit" 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 = [ "bitflags 2.13.0", "cosmic-protocols", @@ -1074,7 +1074,7 @@ dependencies = [ [[package]] name = "cosmic-config" 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 = [ "atomicwrites", "cosmic-config-derive", @@ -1095,7 +1095,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" 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 = [ "quote", "syn", @@ -1145,7 +1145,7 @@ dependencies = [ [[package]] name = "cosmic-protocols" 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 = [ "bitflags 2.13.0", "wayland-backend", @@ -1191,13 +1191,14 @@ dependencies = [ [[package]] name = "cosmic-theme" 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 = [ "almost", "configparser", "cosmic-config", "csscolorparser", "dirs", + "hex_color", "palette", "ron", "serde", @@ -2542,6 +2543,17 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" 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]] name = "hexf-parse" version = "0.2.1" @@ -2627,7 +2639,7 @@ dependencies = [ [[package]] name = "iced" 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 = [ "dnd", "iced_accessibility", @@ -2648,7 +2660,7 @@ dependencies = [ [[package]] name = "iced_accessibility" 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 = [ "accesskit", "accesskit_winit", @@ -2657,7 +2669,7 @@ dependencies = [ [[package]] name = "iced_core" 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 = [ "bitflags 2.13.0", "bytes", @@ -2682,7 +2694,7 @@ dependencies = [ [[package]] name = "iced_debug" 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 = [ "iced_core", "iced_futures", @@ -2692,7 +2704,7 @@ dependencies = [ [[package]] name = "iced_futures" 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 = [ "futures", "iced_core", @@ -2706,7 +2718,7 @@ dependencies = [ [[package]] name = "iced_graphics" 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 = [ "bitflags 2.13.0", "bytemuck", @@ -2727,7 +2739,7 @@ dependencies = [ [[package]] name = "iced_program" 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 = [ "iced_graphics", "iced_runtime", @@ -2736,7 +2748,7 @@ dependencies = [ [[package]] name = "iced_renderer" 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 = [ "iced_graphics", "iced_tiny_skia", @@ -2748,7 +2760,7 @@ dependencies = [ [[package]] name = "iced_runtime" 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 = [ "bytes", "cosmic-client-toolkit", @@ -2763,7 +2775,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" 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 = [ "bytemuck", "cosmic-text", @@ -2798,7 +2810,7 @@ dependencies = [ [[package]] name = "iced_wgpu" 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 = [ "as-raw-xcb-connection", "bitflags 2.13.0", @@ -2829,7 +2841,7 @@ dependencies = [ [[package]] name = "iced_widget" 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 = [ "cosmic-client-toolkit", "dnd", @@ -2847,7 +2859,7 @@ dependencies = [ [[package]] name = "iced_winit" 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 = [ "cosmic-client-toolkit", "cursor-icon", @@ -3106,9 +3118,9 @@ dependencies = [ [[package]] name = "inotify-sys" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +checksum = "6fda9741ca16536952da2ecaa6105c2f4653fa6f0724681df6d2414c4106d0b0" dependencies = [ "libc", ] @@ -3404,7 +3416,7 @@ checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "libcosmic" 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 = [ "apply", "ashpd 0.12.3", @@ -3416,6 +3428,7 @@ dependencies = [ "cosmic-theme", "css-color", "derive_setters", + "enumflags2", "float-cmp 0.10.0", "futures", "i18n-embed", @@ -3475,14 +3488,14 @@ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "libredox" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f02ab6bace2054fb888a3c16f990117b579d14a3088e472d63c6011fa185c9d3" +checksum = "c943259e342f1e06ff2da7a83eabdfe7f92ce10262688dbf1895ff0b3e6e4652" dependencies = [ "bitflags 2.13.0", "libc", "plain", - "redox_syscall 0.8.1", + "redox_syscall 0.9.0", ] [[package]] @@ -4691,6 +4704,8 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" dependencies = [ + "libc", + "rand_chacha 0.3.1", "rand_core 0.6.4", ] @@ -4700,10 +4715,20 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" dependencies = [ - "rand_chacha", + "rand_chacha 0.9.0", "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]] name = "rand_chacha" version = "0.9.0" @@ -4719,6 +4744,9 @@ name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] [[package]] name = "rand_core" @@ -4769,7 +4797,7 @@ dependencies = [ "paste", "profiling", "rand 0.9.4", - "rand_chacha", + "rand_chacha 0.9.0", "simd_helpers", "thiserror 2.0.18", "v_frame", @@ -4840,9 +4868,9 @@ dependencies = [ [[package]] name = "redox_event" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c07d0d6d291e3a951bd847b1cd4af32fc6243d64116cf7702838c02797688b7" +checksum = "c5018d583d6d2f5499352aea8d177e9067d1eb03ab17c78169d5ba7a30001b15" dependencies = [ "bitflags 2.13.0", "libredox", @@ -4859,9 +4887,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b44b894f2a6e36457d665d1e08c3866add6ed5e70050c1b4ba8a8ddedb02ce7" +checksum = "c5102a6aaa05aa011a238e178e6bca86d2cb56fc9f586d37cb80f5bca6e07759" dependencies = [ "bitflags 2.13.0", ] @@ -5605,9 +5633,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.52" +version = "0.3.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e48db7b415311b615f910b3dcaa4557bcd4bf1982379c95c223fd8c2a20e210" +checksum = "18dfaaeddcb932337b5e7866ee7d0ce9b76d2fd092997146f187ec09b4558a50" dependencies = [ "deranged", "libc", diff --git a/Cargo.toml b/Cargo.toml index 5f9ed35..6b79259 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -66,6 +66,9 @@ debug = true # libcosmic = { path = "../libcosmic" } # cosmic-config = { path = "../libcosmic/cosmic-config" } # cosmic-theme = { path = "../libcosmic/cosmic-theme" } -# libcosmic = { git = "https://github.com/pop-os/libcosmic//", branch = "iced-rebase" } -# cosmic-config = { git = "https://github.com/pop-os/libcosmic//", branch = "iced-rebase" } -# cosmic-theme = { 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 = "theme-v2" } +# 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" } diff --git a/src/main.rs b/src/main.rs index b682f40..3275aa9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -893,6 +893,7 @@ impl Application for App { /// Creates the application, and optionally emits command on initialize. fn init(mut core: Core, flags: Self::Flags) -> (Self, Task) { core.window.content_container = false; + core.window.transparent_header = true; #[cfg(feature = "xdg-portal")] let inhibit = { @@ -1034,11 +1035,12 @@ impl Application for App { // This ensures we have a solid background color even when using no content container let theme = self.core.system_theme(); + let bg = theme.cosmic().background(theme.transparent); Some(cosmic::iced::core::theme::Style { - background_color: theme.cosmic().bg_color().into(), - icon_color: theme.cosmic().on_bg_color().into(), - text_color: theme.cosmic().on_bg_color().into(), + background_color: bg.base.into(), + icon_color: bg.on.into(), + text_color: bg.on.into(), }) } @@ -1706,7 +1708,6 @@ impl Application for App { return widget::container(column) .width(Length::Fill) .height(Length::Fill) - .class(theme::Container::WindowBackground) .into(); }; @@ -1727,8 +1728,9 @@ impl Application for App { let mut background_color = Color::BLACK; let mut text_color_opt = None; if !video.has_video() { - background_color = theme.cosmic().bg_component_color().into(); - text_color_opt = Some(Color::from(theme.cosmic().on_bg_component_color())); + let bg = theme.cosmic().background(theme.transparent); + background_color = bg.base.into(); + text_color_opt = Some(Color::from(bg.on)); let mut col = widget::column::with_capacity(10); col = col.push(widget::space::vertical()); @@ -1920,7 +1922,7 @@ impl Application for App { //TODO: move style to libcosmic .class(theme::Container::custom(|theme| { let cosmic = theme.cosmic(); - let component = &cosmic.background.component; + let component = &cosmic.background(theme.transparent).component; widget::container::Style { icon_color: Some(component.on.into()), text_color: Some(component.on.into()),