From a23f181b7f674d56d970c119ad95dfcc595ad885 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Thu, 3 Aug 2023 13:22:17 -0700 Subject: [PATCH] Use `cosmic::Application`/`cosmic::app::applet` This saves a bit of duplicated boilerplate. Applets seem to work fairly well with this. Though we should see if any other changes to initial window settings are needed in certain applets for the exact behavior we want. --- Cargo.lock | 716 ++++++++-------- Cargo.toml | 5 +- applet/Cargo.toml | 13 - applet/src/lib.rs | 258 ------ cosmic-app-list/Cargo.toml | 1 - cosmic-app-list/src/app.rs | 311 ++++--- cosmic-applet-audio/Cargo.toml | 1 - cosmic-applet-audio/src/localize.rs | 2 +- cosmic-applet-audio/src/main.rs | 293 ++++--- cosmic-applet-battery/Cargo.toml | 1 - cosmic-applet-battery/src/app.rs | 361 ++++----- cosmic-applet-bluetooth/Cargo.toml | 1 - cosmic-applet-bluetooth/src/app.rs | 529 ++++++------ cosmic-applet-graphics/Cargo.toml | 1 - cosmic-applet-graphics/src/main.rs | 28 +- cosmic-applet-graphics/src/window.rs | 464 ++++++----- cosmic-applet-network/Cargo.toml | 1 - cosmic-applet-network/src/app.rs | 761 +++++++++--------- cosmic-applet-notifications/Cargo.toml | 1 - cosmic-applet-notifications/src/main.rs | 406 +++++----- cosmic-applet-power/Cargo.toml | 2 +- cosmic-applet-power/src/main.rs | 132 ++- cosmic-applet-time/Cargo.toml | 1 - cosmic-applet-time/src/main.rs | 185 ++--- cosmic-applet-workspaces/Cargo.toml | 1 - .../src/components/app.rs | 76 +- cosmic-panel-button/Cargo.toml | 1 - cosmic-panel-button/src/main.rs | 74 +- 28 files changed, 2029 insertions(+), 2597 deletions(-) delete mode 100644 applet/Cargo.toml delete mode 100644 applet/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 311d67c3..7205f3ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,12 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" - [[package]] name = "accesskit" version = "0.11.0" @@ -38,9 +32,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -75,9 +69,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" dependencies = [ "memchr", ] @@ -88,6 +82,18 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "almost" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3aa2999eb46af81abb65c2d30d446778d7e613b60bbf4e174a027e80f90a3c14" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -105,9 +111,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "apply" @@ -151,6 +157,27 @@ dependencies = [ "libloading 0.7.4", ] +[[package]] +name = "ashpd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7370b58af1d7e96df3ca0f454b57e69acf9aa42ed2d7337bd206923bae0d5754" +dependencies = [ + "enumflags2", + "futures-channel", + "futures-util", + "once_cell", + "rand", + "serde", + "serde_repr", + "tokio", + "url", + "wayland-backend", + "wayland-client 0.30.2", + "wayland-protocols 0.30.1", + "zbus", +] + [[package]] name = "async-broadcast" version = "0.5.1" @@ -214,15 +241,15 @@ dependencies = [ "polling", "rustix 0.37.23", "slab", - "socket2", + "socket2 0.4.9", "waker-fn", ] [[package]] name = "async-lock" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ "event-listener", ] @@ -253,7 +280,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] @@ -264,13 +291,13 @@ checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" [[package]] name = "async-trait" -version = "0.1.72" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] @@ -336,9 +363,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -349,12 +376,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.2" @@ -390,9 +411,12 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +dependencies = [ + "serde", +] [[package]] name = "block" @@ -476,7 +500,7 @@ checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] @@ -507,15 +531,18 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-expr" -version = "0.15.3" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "215c0072ecc28f92eeb0eea38ba63ddfcb65c2828c46311d646f1a3ff5f9841c" +checksum = "b40ccee03b5175c18cde8f37e7d2a33bcef6f8ec8f7cc0d81090d1bb380949c9" dependencies = [ "smallvec", "target-lexicon", @@ -655,7 +682,6 @@ name = "cosmic-app-list" version = "0.1.0" dependencies = [ "anyhow", - "cosmic-applet", "cosmic-client-toolkit", "cosmic-protocols", "freedesktop-desktop-entry", @@ -681,22 +707,10 @@ dependencies = [ "xdg", ] -[[package]] -name = "cosmic-applet" -version = "0.1.0" -dependencies = [ - "cosmic-panel-config", - "libcosmic", - "log", - "ron", - "serde", -] - [[package]] name = "cosmic-applet-audio" version = "0.1.0" dependencies = [ - "cosmic-applet", "cosmic-time", "i18n-embed", "i18n-embed-fl", @@ -715,7 +729,6 @@ dependencies = [ name = "cosmic-applet-battery" version = "0.1.0" dependencies = [ - "cosmic-applet", "cosmic-time", "futures", "i18n-embed", @@ -735,7 +748,6 @@ version = "0.1.0" dependencies = [ "anyhow", "bluer", - "cosmic-applet", "futures", "futures-util", "i18n-embed", @@ -755,7 +767,6 @@ dependencies = [ name = "cosmic-applet-graphics" version = "0.1.0" dependencies = [ - "cosmic-applet", "i18n-embed", "i18n-embed-fl", "libcosmic", @@ -770,7 +781,6 @@ name = "cosmic-applet-network" version = "0.1.0" dependencies = [ "anyhow", - "cosmic-applet", "cosmic-dbus-networkmanager", "cosmic-time", "futures", @@ -794,7 +804,6 @@ version = "0.1.0" dependencies = [ "anyhow", "bytemuck", - "cosmic-applet", "cosmic-notifications-config", "cosmic-notifications-util", "cosmic-time", @@ -817,7 +826,6 @@ dependencies = [ name = "cosmic-applet-power" version = "0.1.0" dependencies = [ - "cosmic-applet", "i18n-embed", "i18n-embed-fl", "icon-loader", @@ -838,7 +846,6 @@ name = "cosmic-applet-time" version = "0.1.0" dependencies = [ "chrono", - "cosmic-applet", "icon-loader", "libcosmic", "nix 0.26.2", @@ -849,7 +856,6 @@ name = "cosmic-applet-workspaces" version = "0.1.0" dependencies = [ "anyhow", - "cosmic-applet", "cosmic-client-toolkit", "cosmic-protocols", "futures", @@ -877,7 +883,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f77bd443d7f4c074040b3b8cc09ed35bd1ca3983" +source = "git+https://github.com/pop-os/libcosmic#fcdefcd8fbca53705ba761b97e25453bc35e40c0" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -891,7 +897,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f77bd443d7f4c074040b3b8cc09ed35bd1ca3983" +source = "git+https://github.com/pop-os/libcosmic#fcdefcd8fbca53705ba761b97e25453bc35e40c0" dependencies = [ "quote", "syn 1.0.109", @@ -905,7 +911,7 @@ dependencies = [ "bitflags 1.3.2", "derive_builder", "procfs", - "time 0.3.23", + "time 0.3.27", "zbus", "zvariant", ] @@ -913,7 +919,7 @@ dependencies = [ [[package]] name = "cosmic-notifications-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-notifications#82b55a63c9d0b00f7d752f1dc9b9291742888e5f" +source = "git+https://github.com/pop-os/cosmic-notifications#35fd49d2b8147859d8b08d68b346096c356a8d15" dependencies = [ "cosmic-config", "serde", @@ -922,7 +928,7 @@ dependencies = [ [[package]] name = "cosmic-notifications-util" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-notifications#82b55a63c9d0b00f7d752f1dc9b9291742888e5f" +source = "git+https://github.com/pop-os/cosmic-notifications#35fd49d2b8147859d8b08d68b346096c356a8d15" dependencies = [ "bytemuck", "fast_image_resize", @@ -936,7 +942,6 @@ dependencies = [ name = "cosmic-panel-button" version = "0.1.0" dependencies = [ - "cosmic-applet", "freedesktop-desktop-entry", "libcosmic", ] @@ -944,7 +949,7 @@ dependencies = [ [[package]] name = "cosmic-panel-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-panel#22571fe4d9496439f6940c4358751424552f84cd" +source = "git+https://github.com/pop-os/cosmic-panel#edfd24ed3b712de397057906924e4f7e8b6252c4" dependencies = [ "anyhow", "cosmic-config", @@ -970,15 +975,16 @@ dependencies = [ [[package]] name = "cosmic-text" -version = "0.8.0" -source = "git+https://github.com/hecrj/cosmic-text.git?rev=b85d6a4f2376f8a8a7dadc0f8bcb89d4db10a1c9#b85d6a4f2376f8a8a7dadc0f8bcb89d4db10a1c9" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0b68966c2543609f8d92f9d33ac3b719b2a67529b0c6c0b3e025637b477eef9" dependencies = [ + "aliasable", "fontdb", "libm", "log", - "ouroboros 0.15.6", "rangemap", - "rustybuzz", + "rustybuzz 0.8.0", "swash", "sys-locale", "unicode-bidi", @@ -990,12 +996,11 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f77bd443d7f4c074040b3b8cc09ed35bd1ca3983" +source = "git+https://github.com/pop-os/libcosmic#fcdefcd8fbca53705ba761b97e25453bc35e40c0" dependencies = [ - "anyhow", + "almost", "cosmic-config", "csscolorparser", - "directories", "lazy_static", "palette", "ron", @@ -1004,8 +1009,8 @@ dependencies = [ [[package]] name = "cosmic-time" -version = "0.2.0" -source = "git+https://github.com/pop-os/cosmic-time?rev=c39e737#c39e737fc55f6c3cbb03a309627da5c525bddd6d" +version = "0.3.0" +source = "git+https://github.com/pop-os/cosmic-time#4013946f9bd9d2e53bf44310b7db783fc8105b79" dependencies = [ "float-cmp", "libcosmic", @@ -1181,7 +1186,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] @@ -1203,14 +1208,14 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core 0.20.3", "quote", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] name = "dashmap" -version = "5.5.0" +version = "5.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6943ae99c34386c84a470c499d3414f66502a41340aa895406e0d2e4a207b91d" +checksum = "edd72493923899c6f10c641bdbdeddc7183d6396641d99c1a0d1597f37f92e28" dependencies = [ "cfg-if", "hashbrown 0.14.0", @@ -1258,6 +1263,12 @@ dependencies = [ "tokio", ] +[[package]] +name = "deranged" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" + [[package]] name = "derivative" version = "2.2.0" @@ -1309,7 +1320,7 @@ dependencies = [ "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] @@ -1322,15 +1333,6 @@ dependencies = [ "crypto-common", ] -[[package]] -name = "directories" -version = "4.0.1" -source = "git+https://github.com/edfloreshz/directories-rs#6a6d83d853a35ee3273034215c4defaf61286fe5" -dependencies = [ - "anyhow", - "dirs-sys 0.3.7", -] - [[package]] name = "dirs" version = "3.0.2" @@ -1389,7 +1391,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] @@ -1448,7 +1450,7 @@ checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] @@ -1485,9 +1487,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" dependencies = [ "errno-dragonfly", "libc", @@ -1531,9 +1533,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "exr" -version = "1.7.0" +version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1e481eb11a482815d3e9d618db8c42a93207134662873809335a92327440c18" +checksum = "279d3efcc55e19917fff7ab3ddd6c14afb6a90881a0078465196fe2f99d08c56" dependencies = [ "bit_field", "flume", @@ -1587,13 +1589,13 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.21" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.3.5", "windows-sys 0.48.0", ] @@ -1608,9 +1610,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", "miniz_oxide", @@ -1690,24 +1692,25 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fontconfig-parser" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ab2e12762761366dcb876ab8b6e0cfa4797ddcd890575919f008b5ba655672a" +checksum = "674e258f4b5d2dcd63888c01c68413c51f565e8af99d2f7701c7b81d79ef41c4" dependencies = [ "roxmltree", ] [[package]] name = "fontdb" -version = "0.13.1" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237ff9f0813bbfc9de836016472e0c9ae7802f174a51594607e5f4ff334cb2f5" +checksum = "af8d8cbea8f21307d7e84bca254772981296f058a1d36b461bf4d83a7499fc9e" dependencies = [ "fontconfig-parser", "log", - "memmap2 0.5.10", + "memmap2 0.6.2", "slotmap", - "ttf-parser", + "tinyvec", + "ttf-parser 0.19.1", ] [[package]] @@ -1851,7 +1854,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] @@ -1949,9 +1952,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "glam" @@ -1961,11 +1964,11 @@ checksum = "42218cb640844e3872cc3c153dc975229e080a6c4733b34709ef445610550226" [[package]] name = "glib" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e7063a7ce573726a0101f449033056d74e0514b5aa9ef194b040c47a4f0209" +checksum = "331156127e8166dd815cf8d2db3a5beb492610c716c03ee6db4f2d07092af0a7" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "futures-channel", "futures-core", "futures-executor", @@ -1992,14 +1995,14 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] name = "glib-sys" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71bf1ba51bfe189b0eefd20989b453ab4c6a073da5abcf49903e8ec3301bfa4c" +checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" dependencies = [ "libc", "system-deps", @@ -2019,8 +2022,9 @@ dependencies = [ [[package]] name = "glyphon" -version = "0.2.0" -source = "git+https://github.com/hecrj/glyphon.git?rev=26f92369da3704988e3e27f0b35e705c6b2de203#26f92369da3704988e3e27f0b35e705c6b2de203" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e87caa7459145f5e5f167bf34db4532901404c679e62339fb712a0e3ccf722a" dependencies = [ "cosmic-text", "etagere", @@ -2103,10 +2107,11 @@ dependencies = [ [[package]] name = "half" -version = "2.2.1" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0" +checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" dependencies = [ + "cfg-if", "crunchy", ] @@ -2119,20 +2124,15 @@ dependencies = [ "ahash 0.7.6", ] -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash 0.8.3", -] - [[package]] name = "hashbrown" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +dependencies = [ + "ahash 0.8.3", + "allocator-api2", +] [[package]] name = "hassle-rs" @@ -2250,7 +2250,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.27", + "syn 2.0.29", "unic-langid", ] @@ -2292,8 +2292,8 @@ dependencies = [ [[package]] name = "iced" -version = "0.9.0" -source = "git+https://github.com/pop-os/libcosmic#f77bd443d7f4c074040b3b8cc09ed35bd1ca3983" +version = "0.10.0" +source = "git+https://github.com/pop-os/libcosmic#fcdefcd8fbca53705ba761b97e25453bc35e40c0" dependencies = [ "iced_accessibility", "iced_core", @@ -2308,7 +2308,7 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f77bd443d7f4c074040b3b8cc09ed35bd1ca3983" +source = "git+https://github.com/pop-os/libcosmic#fcdefcd8fbca53705ba761b97e25453bc35e40c0" dependencies = [ "accesskit", "accesskit_unix", @@ -2316,8 +2316,8 @@ dependencies = [ [[package]] name = "iced_core" -version = "0.9.0" -source = "git+https://github.com/pop-os/libcosmic#f77bd443d7f4c074040b3b8cc09ed35bd1ca3983" +version = "0.10.0" +source = "git+https://github.com/pop-os/libcosmic#fcdefcd8fbca53705ba761b97e25453bc35e40c0" dependencies = [ "bitflags 1.3.2", "iced_accessibility", @@ -2331,8 +2331,8 @@ dependencies = [ [[package]] name = "iced_futures" -version = "0.6.0" -source = "git+https://github.com/pop-os/libcosmic#f77bd443d7f4c074040b3b8cc09ed35bd1ca3983" +version = "0.7.0" +source = "git+https://github.com/pop-os/libcosmic#fcdefcd8fbca53705ba761b97e25453bc35e40c0" dependencies = [ "futures", "iced_core", @@ -2344,37 +2344,38 @@ dependencies = [ [[package]] name = "iced_graphics" -version = "0.8.0" -source = "git+https://github.com/pop-os/libcosmic#f77bd443d7f4c074040b3b8cc09ed35bd1ca3983" +version = "0.9.0" +source = "git+https://github.com/pop-os/libcosmic#fcdefcd8fbca53705ba761b97e25453bc35e40c0" dependencies = [ "bitflags 1.3.2", "bytemuck", "glam", + "half", "iced_core", "image", "kamadak-exif", "log", "raw-window-handle", "thiserror", - "tiny-skia", ] [[package]] name = "iced_renderer" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f77bd443d7f4c074040b3b8cc09ed35bd1ca3983" +source = "git+https://github.com/pop-os/libcosmic#fcdefcd8fbca53705ba761b97e25453bc35e40c0" dependencies = [ "iced_graphics", "iced_tiny_skia", "iced_wgpu", + "log", "raw-window-handle", "thiserror", ] [[package]] name = "iced_runtime" -version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f77bd443d7f4c074040b3b8cc09ed35bd1ca3983" +version = "0.1.1" +source = "git+https://github.com/pop-os/libcosmic#fcdefcd8fbca53705ba761b97e25453bc35e40c0" dependencies = [ "iced_accessibility", "iced_core", @@ -2386,7 +2387,7 @@ dependencies = [ [[package]] name = "iced_sctk" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f77bd443d7f4c074040b3b8cc09ed35bd1ca3983" +source = "git+https://github.com/pop-os/libcosmic#fcdefcd8fbca53705ba761b97e25453bc35e40c0" dependencies = [ "enum-repr", "float-cmp", @@ -2407,8 +2408,8 @@ dependencies = [ [[package]] name = "iced_style" -version = "0.8.0" -source = "git+https://github.com/pop-os/libcosmic#f77bd443d7f4c074040b3b8cc09ed35bd1ca3983" +version = "0.9.0" +source = "git+https://github.com/pop-os/libcosmic#fcdefcd8fbca53705ba761b97e25453bc35e40c0" dependencies = [ "iced_core", "once_cell", @@ -2418,7 +2419,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f77bd443d7f4c074040b3b8cc09ed35bd1ca3983" +source = "git+https://github.com/pop-os/libcosmic#fcdefcd8fbca53705ba761b97e25453bc35e40c0" dependencies = [ "bytemuck", "cosmic-text", @@ -2435,8 +2436,8 @@ dependencies = [ [[package]] name = "iced_wgpu" -version = "0.10.0" -source = "git+https://github.com/pop-os/libcosmic#f77bd443d7f4c074040b3b8cc09ed35bd1ca3983" +version = "0.11.1" +source = "git+https://github.com/pop-os/libcosmic#fcdefcd8fbca53705ba761b97e25453bc35e40c0" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2456,14 +2457,14 @@ dependencies = [ [[package]] name = "iced_widget" -version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f77bd443d7f4c074040b3b8cc09ed35bd1ca3983" +version = "0.1.3" +source = "git+https://github.com/pop-os/libcosmic#fcdefcd8fbca53705ba761b97e25453bc35e40c0" dependencies = [ "iced_renderer", "iced_runtime", "iced_style", "num-traits", - "ouroboros 0.13.0", + "ouroboros", "smithay-client-toolkit 0.17.0", "thiserror", "unicode-segmentation", @@ -2498,9 +2499,9 @@ dependencies = [ [[package]] name = "image" -version = "0.24.6" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527909aa81e20ac3a44803521443a765550f09b5130c2c2fa1ea59c2f8f50a3a" +checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" dependencies = [ "bytemuck", "byteorder", @@ -2517,9 +2518,9 @@ dependencies = [ [[package]] name = "imagesize" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b72ad49b554c1728b1e83254a1b1565aea4161e28dabbfa171fc15fe62299caf" +checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" [[package]] name = "indexmap" @@ -2607,7 +2608,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi 0.3.2", - "rustix 0.38.4", + "rustix 0.38.8", "windows-sys 0.48.0", ] @@ -2675,9 +2676,9 @@ dependencies = [ [[package]] name = "kqueue" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8fc60ba15bf51257aa9807a48a61013db043fcf3a78cb0d916e8e396dcad98" +checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" dependencies = [ "kqueue-sys", "libc", @@ -2685,9 +2686,9 @@ dependencies = [ [[package]] name = "kqueue-sys" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8367585489f01bc55dd27404dcf56b95e6da061a256a666ab23be9ba96a2e587" +checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" dependencies = [ "bitflags 1.3.2", "libc", @@ -2723,10 +2724,12 @@ checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f77bd443d7f4c074040b3b8cc09ed35bd1ca3983" +source = "git+https://github.com/pop-os/libcosmic#fcdefcd8fbca53705ba761b97e25453bc35e40c0" dependencies = [ "apply", + "ashpd", "cosmic-config", + "cosmic-panel-config", "cosmic-theme", "derive_setters", "fraction", @@ -2742,10 +2745,14 @@ dependencies = [ "iced_widget", "lazy_static", "palette", + "ron", "slotmap", "smithay-client-toolkit 0.17.0", + "thiserror", "tokio", "tracing", + "unicode-segmentation", + "url", ] [[package]] @@ -2847,9 +2854,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" [[package]] name = "locale_config" @@ -2876,15 +2883,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "logind-zbus" -version = "3.1.0" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f2cfc54565c8d002ad7344ec08ce512c269b2de56dea59850708691e4b18fe3" +checksum = "c07a2542f6e91ea92780158654852190edb2ba0b232d9d00d649d0c691cb7eb3" dependencies = [ "serde", "zbus", @@ -2892,11 +2899,11 @@ dependencies = [ [[package]] name = "lru" -version = "0.9.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e7d46de488603ffdd5f30afbc64fbba2378214a2c3a2fb83abf3d33126df17" +checksum = "eedb2bdbad7e0634f83989bf596f497b070130daaa398ab22d84c39e266deec5" dependencies = [ - "hashbrown 0.13.2", + "hashbrown 0.14.0", ] [[package]] @@ -2929,6 +2936,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" +dependencies = [ + "libc", +] + [[package]] name = "memmap2" version = "0.7.1" @@ -3093,20 +3109,21 @@ dependencies = [ [[package]] name = "notify" -version = "6.0.1" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5738a2795d57ea20abec2d6d76c6081186709c0024187cd5977265eda6598b51" +checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "crossbeam-channel", "filetime", "fsevent-sys", "inotify", "kqueue", "libc", + "log", "mio", "walkdir", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -3135,9 +3152,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -3146,9 +3163,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" dependencies = [ "num-traits", ] @@ -3257,9 +3274,9 @@ dependencies = [ [[package]] name = "object" -version = "0.31.1" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" dependencies = [ "memchr", ] @@ -3298,49 +3315,26 @@ dependencies = [ [[package]] name = "ouroboros" -version = "0.13.0" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f357ef82d1b4db66fbed0b8d542cbd3c22d0bf5b393b3c257b9ba4568e70c9c3" +checksum = "e2ba07320d39dfea882faa70554b4bd342a5f273ed59ba7c1c6b4c840492c954" dependencies = [ "aliasable", - "ouroboros_macro 0.13.0", - "stable_deref_trait", -] - -[[package]] -name = "ouroboros" -version = "0.15.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1358bd1558bd2a083fed428ffeda486fbfb323e698cdda7794259d592ca72db" -dependencies = [ - "aliasable", - "ouroboros_macro 0.15.6", + "ouroboros_macro", + "static_assertions", ] [[package]] name = "ouroboros_macro" -version = "0.13.0" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44a0b52c2cbaef7dffa5fec1a43274afe8bd2a644fa9fc50a9ef4ff0269b1257" +checksum = "ec4c6225c69b4ca778c0aea097321a64c421cf4577b331c61b229267edabb6f8" dependencies = [ - "Inflector", + "heck", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", -] - -[[package]] -name = "ouroboros_macro" -version = "0.15.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" -dependencies = [ - "Inflector", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", + "syn 2.0.29", ] [[package]] @@ -3351,9 +3345,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "palette" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1641aee47803391405d0a1250e837d2336fdddd18b27f3ddb8c1d80ce8d7f43" +checksum = "b2e2f34147767aa758aa649415b50a69eeb46a67f9dc7db8011eeb3d84b351dc" dependencies = [ "approx", "fast-srgb8", @@ -3364,13 +3358,13 @@ dependencies = [ [[package]] name = "palette_derive" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c02bfa6b3ba8af5434fa0531bf5701f750d983d4260acd6867faca51cdc4484" +checksum = "b7db010ec5ff3d4385e4f133916faacd9dad0f6a09394c92d825b3aed310fa0a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] @@ -3424,7 +3418,7 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec", - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -3463,7 +3457,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] @@ -3483,29 +3477,29 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" [[package]] name = "pin-project" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" [[package]] name = "pin-utils" @@ -3521,9 +3515,9 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "png" -version = "0.17.9" +version = "0.17.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59871cc5b6cce7eaccca5a802b4173377a1c2ba90654246789a8fa2334426d11" +checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -3632,9 +3626,9 @@ dependencies = [ [[package]] name = "profiling" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332cd62e95873ea4f41f3dfd6bbbfc5b52aec892d7e8d534197c4720a0bbbab2" +checksum = "46b2164ebdb1dfeec5e337be164292351e11daf63a05174c6776b2f47460f0c9" [[package]] name = "qoi" @@ -3662,9 +3656,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -3776,9 +3770,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.1" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" dependencies = [ "aho-corasick", "memchr", @@ -3788,9 +3782,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.3" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" dependencies = [ "aho-corasick", "memchr", @@ -3811,9 +3805,9 @@ checksum = "216080ab382b992234dda86873c18d4c48358f5cfcb70fd693d7f6f2131b628b" [[package]] name = "resvg" -version = "0.32.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "142e83d8ae8c8c639f304698a5567b229ba65caba867bf4387bbc0ae158827cf" +checksum = "b6554f47c38eca56827eea7f285c2a3018b4e12e0e195cc105833c008be338f1" dependencies = [ "gif", "jpeg-decoder", @@ -3821,7 +3815,6 @@ dependencies = [ "pico-args", "png", "rgb", - "svgfilters", "svgtypes", "tiny-skia", "usvg", @@ -3838,26 +3831,14 @@ dependencies = [ [[package]] name = "ron" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300a51053b1cb55c80b7a9fde4120726ddf25ca241a1cbb926626f62fb136bff" +checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" dependencies = [ - "base64 0.13.1", - "bitflags 1.3.2", + "base64", + "bitflags 2.4.0", "serde", -] - -[[package]] -name = "rosvgtree" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad747e7384940e7bf33b15ba433b7bad9f44c0c6d5287a67c2cb22cd1743d497" -dependencies = [ - "log", - "roxmltree", - "simplecss", - "siphasher", - "svgtypes", + "serde_derive", ] [[package]] @@ -3889,7 +3870,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.27", + "syn 2.0.29", "walkdir", ] @@ -3955,14 +3936,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.4" +version = "0.38.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys 0.4.3", + "linux-raw-sys 0.4.5", "windows-sys 0.48.0", ] @@ -3977,12 +3958,28 @@ name = "rustybuzz" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "162bdf42e261bee271b3957691018634488084ef577dddeb6420a9684cab2a6a" +dependencies = [ + "bitflags 1.3.2", + "bytemuck", + "smallvec", + "ttf-parser 0.18.1", + "unicode-bidi-mirroring", + "unicode-ccc", + "unicode-general-category", + "unicode-script", +] + +[[package]] +name = "rustybuzz" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82eea22c8f56965eeaf3a209b3d24508256c7b920fb3b6211b8ba0f7c0583250" dependencies = [ "bitflags 1.3.2", "bytemuck", "libm", "smallvec", - "ttf-parser", + "ttf-parser 0.19.1", "unicode-bidi-mirroring", "unicode-ccc", "unicode-general-category", @@ -4034,29 +4031,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.175" +version = "1.0.185" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d25439cd7397d044e2748a6fe2432b5e85db703d6d097bd014b3c0ad1ebff0b" +checksum = "be9b6f69f1dfd54c3b568ffa45c310d6973a5e5148fd40cf515acaf38cf5bc31" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.175" +version = "1.0.185" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b23f7ade6f110613c0d63858ddb8b94c1041f550eab58a16b371bdf2c9c80ab4" +checksum = "dc59dfdcbad1437773485e0367fea4b090a2e0a16d9ffc46af47764536a298ec" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] name = "serde_json" -version = "1.0.103" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" +checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" dependencies = [ "itoa", "ryu", @@ -4065,13 +4062,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e168eaaf71e8f9bd6037feb05190485708e019f4fd87d161b3c0a0d37daf85e5" +checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] @@ -4162,9 +4159,9 @@ checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -4246,6 +4243,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "softbuffer" version = "0.2.0" @@ -4292,12 +4299,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "static_assertions" version = "1.1.0" @@ -4347,16 +4348,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fb1df15f412ee2e9dfc1c504260fa695c1c3f10fe9f4a6ee2d2184d7d6450e2" -[[package]] -name = "svgfilters" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639abcebc15fdc2df179f37d6f5463d660c1c79cd552c12343a4600827a04bce" -dependencies = [ - "float-cmp", - "rgb", -] - [[package]] name = "svgtypes" version = "0.11.0" @@ -4390,9 +4381,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.27" +version = "2.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" +checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" dependencies = [ "proc-macro2", "quote", @@ -4436,9 +4427,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.10" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2faeef5759ab89935255b1a4cd98e0baf99d1085e37d36599c625dac49ae8e" +checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "temp-dir" @@ -4448,14 +4439,14 @@ checksum = "af547b166dd1ea4b472165569fc456cfb6818116f854690b0ff205e636523dab" [[package]] name = "tempfile" -version = "3.7.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", "fastrand 2.0.0", "redox_syscall 0.3.5", - "rustix 0.38.4", + "rustix 0.38.8", "windows-sys 0.48.0", ] @@ -4470,22 +4461,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] @@ -4500,9 +4491,9 @@ dependencies = [ [[package]] name = "tiff" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7449334f9ff2baf290d55d73983a7d6fa15e01198faef72af07e2a8db851e471" +checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" dependencies = [ "flate2", "jpeg-decoder", @@ -4522,10 +4513,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.23" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" +checksum = "0bb39ee79a6d8de55f48f2293a830e040392f1c5f16e336bdd1788cd0aadce07" dependencies = [ + "deranged", "serde", "time-core", ] @@ -4538,9 +4530,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "tiny-skia" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce2986c82f77818c7b9144c70818fdde98db15308e329ae2f7204d767808fd3c" +checksum = "7db11798945fa5c3e5490c794ccca7c6de86d3afdd54b4eb324109939c6f37bc" dependencies = [ "arrayref", "arrayvec", @@ -4553,9 +4545,9 @@ dependencies = [ [[package]] name = "tiny-skia-path" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7acb0ccda1ac91084353a56d0b69b0e29c311fd809d2088b1ed2f9ae1841c47" +checksum = "2f60aa35c89ac2687ace1a2556eaaea68e8c0d47408a2e3e7f5c98a489e7281c" dependencies = [ "arrayref", "bytemuck", @@ -4588,11 +4580,10 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", @@ -4601,7 +4592,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.3", "tokio-macros", "tracing", "windows-sys 0.48.0", @@ -4615,7 +4606,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] @@ -4692,7 +4683,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", ] [[package]] @@ -4736,6 +4727,12 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0609f771ad9c6155384897e1df4d948e692667cc0588548b68eb44d052b27633" +[[package]] +name = "ttf-parser" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a464a4b34948a5f67fddd2b823c62d9d92e44be75058b99939eae6c5b6960b33" + [[package]] name = "twox-hash" version = "1.6.3" @@ -4875,15 +4872,16 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] name = "usvg" -version = "0.32.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b44e14b7678bcc5947b397991432d0c4e02a103958a0ed5e1b9b961ddd08b21" +checksum = "14d09ddfb0d93bf84824c09336d32e42f80961a9d1680832eb24fdf249ce11e6" dependencies = [ - "base64 0.21.2", + "base64", "log", "pico-args", "usvg-parser", @@ -4894,31 +4892,32 @@ dependencies = [ [[package]] name = "usvg-parser" -version = "0.32.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90c8251d965c2882a636ffcc054340b1f13a6bce68779cb5b2084d8ffc2535be" +checksum = "d19bf93d230813599927d88557014e0908ecc3531666d47c634c6838bc8db408" dependencies = [ "data-url", "flate2", "imagesize", "kurbo", "log", - "rosvgtree", - "strict-num", + "roxmltree", + "simplecss", + "siphasher", "svgtypes", "usvg-tree", ] [[package]] name = "usvg-text-layout" -version = "0.32.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c4fed019d1af07bfe0f3bac13d120d7b51bc65b38cb24809cf4ed0b8b631138" +checksum = "035044604e89652c0a2959b8b356946997a52649ba6cade45928c2842376feb4" dependencies = [ "fontdb", "kurbo", "log", - "rustybuzz", + "rustybuzz 0.7.0", "unicode-bidi", "unicode-script", "unicode-vo", @@ -4927,14 +4926,14 @@ dependencies = [ [[package]] name = "usvg-tree" -version = "0.32.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7371265c467cdae0ccc3655e2e3f310c695fb9f717c0d25187bf3b333f7b5159" +checksum = "7939a7e4ed21cadb5d311d6339730681c3e24c3e81d60065be80e485d3fc8b92" dependencies = [ - "kurbo", "rctree", "strict-num", "svgtypes", + "tiny-skia-path", ] [[package]] @@ -5019,7 +5018,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", "wasm-bindgen-shared", ] @@ -5053,7 +5052,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.29", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5141,7 +5140,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72191e30290b83491325d32c1327be7f45459c97263d9d48494c81efc9328116" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "cursor-icon", "wayland-backend", ] @@ -5314,7 +5313,7 @@ checksum = "8f478237b4bf0d5b70a39898a66fa67ca3a007d79f2520485b8b0c3dfc46f8c2" dependencies = [ "arrayvec", "bit-vec", - "bitflags 2.3.3", + "bitflags 2.4.0", "codespan-reporting", "log", "naga", @@ -5339,7 +5338,7 @@ dependencies = [ "arrayvec", "ash", "bit-set", - "bitflags 2.3.3", + "bitflags 2.4.0", "block", "core-graphics-types", "d3d12", @@ -5377,7 +5376,7 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0c153280bb108c2979eb5c7391cb18c56642dd3c072e55f52065e13e2a1252a" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "js-sys", "web-sys", ] @@ -5443,7 +5442,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -5476,7 +5475,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -5496,17 +5495,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -5517,9 +5516,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -5529,9 +5528,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -5541,9 +5540,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -5553,9 +5552,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -5565,9 +5564,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -5577,9 +5576,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -5589,15 +5588,15 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.1" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b5872fa2e10bd067ae946f927e726d7d603eaeb6e02fa6a350e0722d2b8c11" +checksum = "d09770118a7eb1ccaf4a594a221334119a44a814fcb0d31c5b85e83e97227a97" dependencies = [ "memchr", ] @@ -5666,7 +5665,7 @@ dependencies = [ [[package]] name = "xdg-shell-wrapper-config" version = "0.1.0" -source = "git+https://github.com/pop-os/xdg-shell-wrapper#8024f9e33fdbf188c34543566102dfb7755adf7a" +source = "git+https://github.com/pop-os/xdg-shell-wrapper#9ae1c4c838fe58e887b62d2a990d73ab2f6cb629" dependencies = [ "serde", "wayland-protocols-wlr", @@ -5799,6 +5798,7 @@ dependencies = [ "libc", "serde", "static_assertions", + "url", "zvariant_derive", ] diff --git a/Cargo.toml b/Cargo.toml index d71f32f5..96e8ad79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,6 @@ [workspace] members = [ - "applet", "cosmic-app-list", "cosmic-applet-audio", "cosmic-applet-battery", @@ -20,8 +19,8 @@ resolver="2" [workspace.dependencies] cctk = { git = "https://github.com/pop-os/cosmic-protocols", package = "cosmic-client-toolkit", rev = "e39748e" } cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols", default-features = false, features = ["client"], rev = "e39748e" } -cosmic-time = { git = "https://github.com/pop-os/cosmic-time", rev = "c39e737", default-features = false, features = ["libcosmic", "once_cell"] } -libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false, features = ["tokio", "wayland"] } +cosmic-time = { git = "https://github.com/pop-os/cosmic-time", default-features = false, features = ["libcosmic", "once_cell"] } +libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false, features = ["applet", "tokio", "wayland"] } [profile.release] lto = "thin" diff --git a/applet/Cargo.toml b/applet/Cargo.toml deleted file mode 100644 index 328cc5b0..00000000 --- a/applet/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "cosmic-applet" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -libcosmic.workspace = true -ron = { version = "0.8" } -serde = { version = "1.0" } -cosmic-panel-config = { git = "https://github.com/pop-os/cosmic-panel" } -log = { version = "0.4" } diff --git a/applet/src/lib.rs b/applet/src/lib.rs deleted file mode 100644 index c1825694..00000000 --- a/applet/src/lib.rs +++ /dev/null @@ -1,258 +0,0 @@ -use std::sync::Arc; - -use cosmic::{ - cosmic_config::{config_subscription, CosmicConfigEntry}, - cosmic_theme::util::CssColor, - iced::{ - alignment::{Horizontal, Vertical}, - wayland::InitialSurface, - widget::{self, Container}, - window, Color, Element, Length, Limits, Rectangle, Settings, - }, - iced_futures::Subscription, - iced_style, iced_widget, sctk, - theme::Button, - Renderer, -}; -use cosmic_panel_config::{CosmicPanelBackground, PanelAnchor, PanelSize}; -use iced_style::{button::StyleSheet, container::Appearance}; -use iced_widget::runtime::command::platform_specific::wayland::{ - popup::{SctkPopupSettings, SctkPositioner}, - window::SctkWindowSettings, -}; -use log::error; -use sctk::reexports::protocols::xdg::shell::client::xdg_positioner::{Anchor, Gravity}; - -pub use cosmic_panel_config; - -const APPLET_PADDING: u32 = 8; - -#[must_use] -pub fn applet_button_theme() -> Button { - Button::Custom { - active: Box::new(|t| iced_style::button::Appearance { - border_radius: 0.0.into(), - ..t.active(&Button::Text) - }), - hover: Box::new(|t| iced_style::button::Appearance { - border_radius: 0.0.into(), - ..t.hovered(&Button::Text) - }), - } -} - -#[derive(Debug, Clone)] -pub struct CosmicAppletHelper { - pub size: Size, - pub anchor: PanelAnchor, - pub background: CosmicPanelBackground, - pub output_name: String, -} - -#[derive(Clone, Debug)] -pub enum Size { - PanelSize(PanelSize), - // (width, height) - Hardcoded((u16, u16)), -} - -impl Default for CosmicAppletHelper { - fn default() -> Self { - Self { - size: Size::PanelSize( - std::env::var("COSMIC_PANEL_SIZE") - .ok() - .and_then(|size| ron::from_str(size.as_str()).ok()) - .unwrap_or(PanelSize::S), - ), - anchor: std::env::var("COSMIC_PANEL_ANCHOR") - .ok() - .and_then(|size| ron::from_str(size.as_str()).ok()) - .unwrap_or(PanelAnchor::Top), - background: std::env::var("COSMIC_PANEL_BACKGROUND") - .ok() - .and_then(|size| ron::from_str(size.as_str()).ok()) - .unwrap_or(CosmicPanelBackground::ThemeDefault), - output_name: std::env::var("COSMIC_PANEL_OUTPUT").unwrap_or_default(), - } - } -} - -impl CosmicAppletHelper { - #[must_use] - pub fn suggested_size(&self) -> (u16, u16) { - match &self.size { - Size::PanelSize(size) => match size { - PanelSize::XL => (64, 64), - PanelSize::L => (36, 36), - PanelSize::M => (24, 24), - PanelSize::S => (16, 16), - PanelSize::XS => (12, 12), - }, - Size::Hardcoded((width, height)) => (*width, *height), - } - } - - // Set the default window size. Helper for application init with hardcoded size. - pub fn window_size(&mut self, width: u16, height: u16) { - self.size = Size::Hardcoded((width, height)); - } - - #[must_use] - pub fn window_settings(&self) -> Settings { - self.window_settings_with_flags(F::default()) - } - - #[must_use] - #[allow(clippy::cast_precision_loss)] - pub fn window_settings_with_flags(&self, flags: F) -> Settings { - let (width, height) = self.suggested_size(); - let width = u32::from(width); - let height = u32::from(height); - Settings { - initial_surface: InitialSurface::XdgWindow(SctkWindowSettings { - size: (width + APPLET_PADDING * 2, height + APPLET_PADDING * 2), - size_limits: Limits::NONE - .min_height(height as f32 + APPLET_PADDING as f32 * 2.0) - .max_height(height as f32 + APPLET_PADDING as f32 * 2.0) - .min_width(width as f32 + APPLET_PADDING as f32 * 2.0) - .max_width(width as f32 + APPLET_PADDING as f32 * 2.0), - resizable: None, - ..Default::default() - }), - default_text_size: 18.0, - default_font: cosmic::font::FONT, - ..Settings::with_flags(flags) - } - } - - #[must_use] - pub fn icon_button<'a, Message: 'static>( - &self, - icon_name: &'a str, - ) -> widget::Button<'a, Message, Renderer> { - cosmic::widget::button(cosmic::theme::Button::Text) - .icon( - cosmic::theme::Svg::Symbolic, - icon_name, - self.suggested_size().0, - ) - .padding(8) - } - - // TODO popup container which tracks the size of itself and requests the popup to resize to match - pub fn popup_container<'a, Message: 'static>( - &self, - content: impl Into>, - ) -> Container<'a, Message, Renderer> { - let (vertical_align, horizontal_align) = match self.anchor { - PanelAnchor::Left => (Vertical::Center, Horizontal::Left), - PanelAnchor::Right => (Vertical::Center, Horizontal::Right), - PanelAnchor::Top => (Vertical::Top, Horizontal::Center), - PanelAnchor::Bottom => (Vertical::Bottom, Horizontal::Center), - }; - - Container::::new(Container::::new(content).style( - cosmic::theme::Container::custom(|theme| Appearance { - text_color: Some(theme.cosmic().background.on.into()), - background: Some(Color::from(theme.cosmic().background.base).into()), - border_radius: 12.0.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, - }), - )) - .width(Length::Shrink) - .height(Length::Shrink) - .align_x(horizontal_align) - .align_y(vertical_align) - } - - #[must_use] - #[allow(clippy::cast_possible_wrap)] - pub fn get_popup_settings( - &self, - parent: window::Id, - id: window::Id, - size: Option<(u32, u32)>, - width_padding: Option, - height_padding: Option, - ) -> SctkPopupSettings { - let (width, height) = self.suggested_size(); - let pixel_offset = 8; - let (offset, anchor, gravity) = match self.anchor { - PanelAnchor::Left => ((pixel_offset, 0), Anchor::Right, Gravity::Right), - PanelAnchor::Right => ((-pixel_offset, 0), Anchor::Left, Gravity::Left), - PanelAnchor::Top => ((0, pixel_offset), Anchor::Bottom, Gravity::Bottom), - PanelAnchor::Bottom => ((0, -pixel_offset), Anchor::Top, Gravity::Top), - }; - SctkPopupSettings { - parent, - id, - positioner: SctkPositioner { - anchor, - gravity, - offset, - size, - anchor_rect: Rectangle { - x: 0, - y: 0, - width: width_padding.unwrap_or(APPLET_PADDING as i32) * 2 + i32::from(width), - height: height_padding.unwrap_or(APPLET_PADDING as i32) * 2 + i32::from(height), - }, - reactive: true, - constraint_adjustment: 15, // slide_y, slide_x, flip_x, flip_y - ..Default::default() - }, - parent_size: None, - grab: true, - } - } - - pub fn theme(&self) -> cosmic::theme::Theme { - match self.background { - CosmicPanelBackground::ThemeDefault | CosmicPanelBackground::Color(_) => { - let Ok(helper) = cosmic::cosmic_config::Config::new( - cosmic::cosmic_theme::NAME, - cosmic::cosmic_theme::Theme::::version() as u64, - ) else { - return cosmic::theme::Theme::dark(); - }; - let t = cosmic::cosmic_theme::Theme::get_entry(&helper) - .map(|t| t.into_srgba()) - .unwrap_or_else(|(errors, theme)| { - for err in errors { - error!("{:?}", err); - } - theme.into_srgba() - }); - cosmic::theme::Theme::custom(Arc::new(t)) - } - CosmicPanelBackground::Dark => cosmic::theme::Theme::dark(), - CosmicPanelBackground::Light => cosmic::theme::Theme::light(), - } - } - - pub fn theme_subscription(&self, id: u64) -> Subscription { - match self.background { - CosmicPanelBackground::ThemeDefault | CosmicPanelBackground::Color(_) => { - config_subscription::>( - id, - cosmic::cosmic_theme::NAME.into(), - cosmic::cosmic_theme::Theme::::version() as u64, - ) - .map(|(_, res)| { - let theme = - res.map(|theme| theme.into_srgba()) - .unwrap_or_else(|(errors, theme)| { - for err in errors { - error!("{:?}", err); - } - theme.into_srgba() - }); - cosmic::theme::Theme::custom(Arc::new(theme)) - }) - } - CosmicPanelBackground::Dark | CosmicPanelBackground::Light => Subscription::none(), - } - } -} diff --git a/cosmic-app-list/Cargo.toml b/cosmic-app-list/Cargo.toml index 60497a04..566abbf9 100644 --- a/cosmic-app-list/Cargo.toml +++ b/cosmic-app-list/Cargo.toml @@ -8,7 +8,6 @@ edition = "2021" cctk.workspace = true cosmic-protocols.workspace = true libcosmic.workspace = true -cosmic-applet = { path = "../applet" } # libcosmic = { path = "../../libcosmic", default-features = false, features = ["wayland", "tokio"] } ron = "0.8" futures = "0.3" diff --git a/cosmic-app-list/src/app.rs b/cosmic-app-list/src/app.rs index c0d0ecfa..f2dd062a 100755 --- a/cosmic-app-list/src/app.rs +++ b/cosmic-app-list/src/app.rs @@ -9,13 +9,16 @@ use cctk::sctk::reexports::calloop::channel::Sender; use cctk::toplevel_info::ToplevelInfo; use cctk::wayland_client::protocol::wl_data_device_manager::DndAction; use cctk::wayland_client::protocol::wl_seat::WlSeat; +use cosmic::app::{ + applet::{cosmic_panel_config::PanelAnchor, CosmicAppletHelper}, + Command, +}; use cosmic::cosmic_config; use cosmic::cosmic_config::Config; use cosmic::iced; use cosmic::iced::subscription::events_with; use cosmic::iced::wayland::actions::data_device::DataFromMimeType; use cosmic::iced::wayland::actions::data_device::DndIcon; -use cosmic::iced::wayland::actions::window::SctkWindowSettings; use cosmic::iced::wayland::popup::destroy_popup; use cosmic::iced::wayland::popup::get_popup; use cosmic::iced::widget::dnd_listener; @@ -23,9 +26,7 @@ use cosmic::iced::widget::vertical_rule; use cosmic::iced::widget::vertical_space; use cosmic::iced::widget::{column, dnd_source, mouse_area, row, Column, Row}; use cosmic::iced::Color; -use cosmic::iced::Limits; -use cosmic::iced::Settings; -use cosmic::iced::{window, Application, Command, Subscription}; +use cosmic::iced::{window, Subscription}; use cosmic::iced_runtime::core::alignment::Horizontal; use cosmic::iced_runtime::core::event; use cosmic::iced_sctk::commands::data_device::accept_mime_type; @@ -33,16 +34,13 @@ use cosmic::iced_sctk::commands::data_device::finish_dnd; use cosmic::iced_sctk::commands::data_device::request_dnd_data; use cosmic::iced_sctk::commands::data_device::set_actions; use cosmic::iced_sctk::commands::data_device::start_drag; -use cosmic::iced_sctk::settings::InitialSurface; -use cosmic::iced_style::application::{self, Appearance}; +use cosmic::iced_style::application; use cosmic::theme::Button; use cosmic::widget::divider; use cosmic::widget::rectangle_tracker::rectangle_tracker_subscription; use cosmic::widget::rectangle_tracker::RectangleTracker; use cosmic::widget::rectangle_tracker::RectangleUpdate; use cosmic::{Element, Theme}; -use cosmic_applet::cosmic_panel_config::PanelAnchor; -use cosmic_applet::CosmicAppletHelper; use cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1; use freedesktop_desktop_entry::DesktopEntry; use futures::future::pending; @@ -64,30 +62,7 @@ use url::Url; static MIME_TYPE: &str = "text/uri-list"; pub fn run() -> cosmic::iced::Result { - let helper = CosmicAppletHelper::default(); - let pixel_size = helper.suggested_size().0; - let padding = 8; - let dot_size = 4; - let spacing = 4; - let thickness = (pixel_size + 2 * padding + dot_size + spacing) as u32; - let (w, h) = match helper.anchor { - PanelAnchor::Top | PanelAnchor::Bottom => (2000, thickness), - PanelAnchor::Left | PanelAnchor::Right => (thickness, 2000), - }; - - CosmicAppList::run(Settings { - initial_surface: InitialSurface::XdgWindow(SctkWindowSettings { - autosize: true, - size_limits: Limits::NONE - .min_height(1.0) - .min_width(1.0) - .max_height(h as f32) - .max_width(w as f32), - resizable: None, - ..Default::default() - }), - ..Default::default() - }) + cosmic::app::applet::run::(false, ()) } #[derive(Debug, Clone, Default)] @@ -150,7 +125,7 @@ impl DockItem { .map(|_| { container(vertical_space(Length::Fixed(0.0))) .padding(dot_radius) - .style(<::Theme as container::StyleSheet>::Style::Custom(Box::new( + .style(::Style::Custom(Box::new( |theme| container::Appearance { text_color: Some(Color::TRANSPARENT), background: Some(Background::Color( @@ -224,7 +199,7 @@ struct DndOffer { #[derive(Clone, Default)] struct CosmicAppList { - theme: Theme, + core: cosmic::app::Core, popup: Option<(window::Id, DockItem)>, surface_id_ctr: u128, subscription_ctr: u32, @@ -234,7 +209,6 @@ struct CosmicAppList { dnd_source: Option<(window::Id, DockItem, DndAction)>, config: AppListConfig, toplevel_sender: Option>, - applet_helper: CosmicAppletHelper, seat: Option, rectangle_tracker: Option>, rectangles: HashMap, @@ -268,7 +242,6 @@ enum Message { StopListeningForDnd, IncrementSubscriptionCtr, ConfigUpdated(AppListConfig), - Theme(Theme), } #[derive(Debug, Clone, Default)] @@ -317,7 +290,16 @@ fn desktop_info_for_app_ids(mut app_ids: Vec) -> Vec { }) .collect_vec(), ); - ret.sort_by(|a, b| app_ids_clone.iter().position(|id| id == &a.id || id.eq(&a.name)).cmp(&app_ids_clone.iter().position(|id| id == &b.id || id.eq(&b.name)))); + ret.sort_by(|a, b| { + app_ids_clone + .iter() + .position(|id| id == &a.id || id.eq(&a.name)) + .cmp( + &app_ids_clone + .iter() + .position(|id| id == &b.id || id.eq(&b.name)), + ) + }); ret } @@ -364,17 +346,16 @@ fn index_in_list( } } -impl Application for CosmicAppList { +impl cosmic::Application for CosmicAppList { type Message = Message; - type Theme = Theme; type Executor = cosmic::SingleThreadExecutor; type Flags = (); + const APP_ID: &'static str = config::APP_ID; - fn new(_flags: ()) -> (Self, Command) { + fn init(core: cosmic::app::Core, _flags: ()) -> (Self, Command) { let config = config::AppListConfig::load().unwrap_or_default(); - let helper = CosmicAppletHelper::default(); - let theme = helper.theme(); let mut self_ = CosmicAppList { + core, favorite_list: desktop_info_for_app_ids(config.favorites.clone()) .into_iter() .enumerate() @@ -384,9 +365,7 @@ impl Application for CosmicAppList { desktop_info: e, }) .collect(), - applet_helper: helper, config, - theme, ..Default::default() }; self_.item_ctr = self_.favorite_list.len() as u32; @@ -394,8 +373,12 @@ impl Application for CosmicAppList { (self_, Command::none()) } - fn title(&self) -> String { - config::APP_ID.to_string() + fn core(&self) -> &cosmic::app::Core { + &self.core + } + + fn core_mut(&mut self) -> &mut cosmic::app::Core { + &mut self.core } fn update(&mut self, message: Message) -> Command { @@ -419,7 +402,7 @@ impl Application for CosmicAppList { let new_id = window::Id(self.surface_id_ctr); self.popup = Some((new_id, toplevel_group.clone())); - let mut popup_settings = self.applet_helper.get_popup_settings( + let mut popup_settings = self.core.applet_helper.get_popup_settings( window::Id(0), new_id, None, @@ -562,8 +545,8 @@ impl Application for CosmicAppList { } } Message::DndEnter(x, y) => { - let item_size = self.applet_helper.suggested_size().0; - let pos_in_list = match self.applet_helper.anchor { + let item_size = self.core.applet_helper.suggested_size().0; + let pos_in_list = match self.core.applet_helper.anchor { PanelAnchor::Top | PanelAnchor::Bottom => x, PanelAnchor::Left | PanelAnchor::Right => y, }; @@ -593,8 +576,8 @@ impl Application for CosmicAppList { } Message::DndMotion(x, y) => { if let Some(DndOffer { preview_index, .. }) = self.dnd_offer.as_mut() { - let item_size = self.applet_helper.suggested_size().0; - let pos_in_list = match self.applet_helper.anchor { + let item_size = self.core.applet_helper.suggested_size().0; + let pos_in_list = match self.core.applet_helper.anchor { PanelAnchor::Top | PanelAnchor::Bottom => x, PanelAnchor::Left | PanelAnchor::Right => y, }; @@ -646,7 +629,7 @@ impl Application for CosmicAppList { .and_then(|o| o.dock_item.map(|i| (i, o.preview_index))) { self.item_ctr += 1; - + if let Some((pos, is_favorite)) = self .active_list .iter() @@ -674,7 +657,13 @@ impl Application for CosmicAppList { self.favorite_list .insert(index.min(self.favorite_list.len()), dock_item); - self.config.update_favorites(self.favorite_list.iter().map(|dock_item| dock_item.desktop_info.id.clone()).collect(), &Config::new(APP_ID, 1).unwrap()); + self.config.update_favorites( + self.favorite_list + .iter() + .map(|dock_item| dock_item.desktop_info.id.clone()) + .collect(), + &Config::new(APP_ID, 1).unwrap(), + ); } return finish_dnd(); } @@ -715,7 +704,7 @@ impl Application for CosmicAppList { let subscription_ctr = self.subscription_ctr; let mut rng = thread_rng(); let rand_d = rng.gen_range(0..100); - return Command::perform( + return iced::Command::perform( async move { if let Some(millis) = 2u64 .checked_pow(subscription_ctr) @@ -727,7 +716,8 @@ impl Application for CosmicAppList { } }, |_| Message::IncrementSubscriptionCtr, - ); + ) + .map(cosmic::app::message::app); } ToplevelUpdate::RemoveToplevel(handle) => { for t in self @@ -810,111 +800,41 @@ impl Application for CosmicAppList { } // pull back configured items into the favorites list - self.favorite_list = desktop_info_for_app_ids(self.config.favorites.clone()).into_iter().map(|new_dock_item| { - if let Some(p) = self.active_list.iter().position(|dock_item| { - dock_item.desktop_info.id == new_dock_item.id - }) { - self.active_list.remove(p) - } else { - DockItem { - id: self.item_ctr, - toplevels: Default::default(), - desktop_info: new_dock_item, + self.favorite_list = desktop_info_for_app_ids(self.config.favorites.clone()) + .into_iter() + .map(|new_dock_item| { + if let Some(p) = self + .active_list + .iter() + .position(|dock_item| dock_item.desktop_info.id == new_dock_item.id) + { + self.active_list.remove(p) + } else { + DockItem { + id: self.item_ctr, + toplevels: Default::default(), + desktop_info: new_dock_item, + } } - } - }).collect(); - } - Message::Theme(t) => { - self.theme = t; + }) + .collect(); } } Command::none() } - fn view(&self, id: window::Id) -> Element { - let is_horizontal = match self.applet_helper.anchor { + fn view(&self) -> Element { + let is_horizontal = match self.core.applet_helper.anchor { PanelAnchor::Top | PanelAnchor::Bottom => true, PanelAnchor::Left | PanelAnchor::Right => false, }; - if let Some((_, item, _)) = self.dnd_source.as_ref().filter(|s| s.0 == id) { - return cosmic::widget::icon( - Path::new(&item.desktop_info.icon), - self.applet_helper.suggested_size().0, - ) - .into(); - } - if let Some(( - _popup_id, - DockItem { - toplevels, - desktop_info, - .. - }, - )) = self.popup.as_ref().filter(|p| id == p.0) - { - let is_favorite = self.config.favorites.contains(&desktop_info.id) - || self.config.favorites.contains(&desktop_info.name); - - let mut content = column![ - iced::widget::text(&desktop_info.name).horizontal_alignment(Horizontal::Center), - cosmic::widget::button(Button::Text) - .custom(vec![iced::widget::text(fl!("new-window")).into()]) - .on_press(Message::Exec(desktop_info.exec.clone())), - ] - .padding(8) - .spacing(4) - .align_items(Alignment::Center); - if !toplevels.is_empty() { - let mut list_col = column![]; - for (handle, info) in toplevels { - let title = if info.title.len() > 20 { - format!("{:.24}...", &info.title) - } else { - info.title.clone() - }; - list_col = list_col.push( - cosmic::widget::button(Button::Text) - .custom(vec![iced::widget::text(title).into()]) - .on_press(Message::Activate(handle.clone())), - ); - } - content = content.push(divider::horizontal::light()); - content = content.push(list_col); - content = content.push(divider::horizontal::light()); - } - content = content.push(if is_favorite { - cosmic::widget::button(Button::Text) - .custom(vec![iced::widget::text(fl!("unfavorite")).into()]) - .on_press(Message::UnFavorite(desktop_info.id.clone())) - } else { - cosmic::widget::button(Button::Text) - .custom(vec![iced::widget::text(fl!("favorite")).into()]) - .on_press(Message::Favorite(desktop_info.id.clone())) - }); - - content = match toplevels.len() { - 0 => content, - 1 => content.push( - cosmic::widget::button(Button::Text) - .custom(vec![iced::widget::text(fl!("quit")).into()]) - .on_press(Message::Quit(desktop_info.id.clone())), - ), - _ => content.push( - cosmic::widget::button(Button::Text) - .custom(vec![iced::widget::text(&fl!("quit-all")).into()]) - .on_press(Message::Quit(desktop_info.id.clone())), - ), - }; - return self.applet_helper.popup_container(content).into(); - } - let mut favorites: Vec<_> = self .favorite_list .iter() .map(|dock_item| { dock_item.as_icon( - &self.applet_helper, + &self.core.applet_helper, self.rectangle_tracker.as_ref(), self.popup.is_none(), ) @@ -926,13 +846,13 @@ impl Application for CosmicAppList { .as_ref() .and_then(|o| o.dock_item.as_ref().map(|item| (item, o.preview_index))) { - favorites.insert(index, item.as_icon(&self.applet_helper, None, false)); + favorites.insert(index, item.as_icon(&self.core.applet_helper, None, false)); } else if self.is_listening_for_dnd && self.favorite_list.is_empty() { // show star indicating favorite_list is drag target favorites.push( container(cosmic::widget::icon( "starred-symbolic.symbolic", - self.applet_helper.suggested_size().0, + self.core.applet_helper.suggested_size().0, )) .padding(8) .into(), @@ -944,7 +864,7 @@ impl Application for CosmicAppList { .iter() .map(|dock_item| { dock_item.as_icon( - &self.applet_helper, + &self.core.applet_helper, self.rectangle_tracker.as_ref(), self.popup.is_none(), ) @@ -1011,12 +931,12 @@ impl Application for CosmicAppList { } else { vec![cosmic::widget::icon( "com.system76.CosmicAppList", - self.applet_helper.suggested_size().0, + self.core.applet_helper.suggested_size().0, ) .into()] }; - let content = match &self.applet_helper.anchor { + let content = match &self.core.applet_helper.anchor { PanelAnchor::Left | PanelAnchor::Right => container( Column::with_children(content_list) .spacing(4) @@ -1042,9 +962,83 @@ impl Application for CosmicAppList { } } + fn view_window(&self, id: window::Id) -> Element { + if let Some((_, item, _)) = self.dnd_source.as_ref().filter(|s| s.0 == id) { + cosmic::widget::icon( + Path::new(&item.desktop_info.icon), + self.core.applet_helper.suggested_size().0, + ) + .into() + } else if let Some(( + _popup_id, + DockItem { + toplevels, + desktop_info, + .. + }, + )) = self.popup.as_ref().filter(|p| id == p.0) + { + let is_favorite = self.config.favorites.contains(&desktop_info.id) + || self.config.favorites.contains(&desktop_info.name); + + let mut content = column![ + iced::widget::text(&desktop_info.name).horizontal_alignment(Horizontal::Center), + cosmic::widget::button(Button::Text) + .custom(vec![iced::widget::text(fl!("new-window")).into()]) + .on_press(Message::Exec(desktop_info.exec.clone())), + ] + .padding(8) + .spacing(4) + .align_items(Alignment::Center); + if !toplevels.is_empty() { + let mut list_col = column![]; + for (handle, info) in toplevels { + let title = if info.title.len() > 20 { + format!("{:.24}...", &info.title) + } else { + info.title.clone() + }; + list_col = list_col.push( + cosmic::widget::button(Button::Text) + .custom(vec![iced::widget::text(title).into()]) + .on_press(Message::Activate(handle.clone())), + ); + } + content = content.push(divider::horizontal::light()); + content = content.push(list_col); + content = content.push(divider::horizontal::light()); + } + content = content.push(if is_favorite { + cosmic::widget::button(Button::Text) + .custom(vec![iced::widget::text(fl!("unfavorite")).into()]) + .on_press(Message::UnFavorite(desktop_info.id.clone())) + } else { + cosmic::widget::button(Button::Text) + .custom(vec![iced::widget::text(fl!("favorite")).into()]) + .on_press(Message::Favorite(desktop_info.id.clone())) + }); + + content = match toplevels.len() { + 0 => content, + 1 => content.push( + cosmic::widget::button(Button::Text) + .custom(vec![iced::widget::text(fl!("quit")).into()]) + .on_press(Message::Quit(desktop_info.id.clone())), + ), + _ => content.push( + cosmic::widget::button(Button::Text) + .custom(vec![iced::widget::text(&fl!("quit-all")).into()]) + .on_press(Message::Quit(desktop_info.id.clone())), + ), + }; + self.core.applet_helper.popup_container(content).into() + } else { + iced::widget::text("").into() + } + } + fn subscription(&self) -> Subscription { Subscription::batch(vec![ - self.applet_helper.theme_subscription(0).map(Message::Theme), toplevel_subscription(self.subscription_ctr).map(Message::Toplevel), events_with(|e, _| match e { cosmic::iced_runtime::core::Event::PlatformSpecific( @@ -1095,18 +1089,7 @@ impl Application for CosmicAppList { ]) } - fn theme(&self) -> Theme { - self.theme.clone() - } - - fn close_requested(&self, _id: window::Id) -> Self::Message { - Message::Ignore - } - - fn style(&self) -> ::Style { - ::Style::Custom(Box::new(|theme| Appearance { - background_color: Color::from_rgba(0.0, 0.0, 0.0, 0.0), - text_color: theme.cosmic().on_bg_color().into(), - })) + fn style(&self) -> Option<::Style> { + Some(cosmic::app::applet::style()) } } diff --git a/cosmic-applet-audio/Cargo.toml b/cosmic-applet-audio/Cargo.toml index 6e329ced..a859c8db 100644 --- a/cosmic-applet-audio/Cargo.toml +++ b/cosmic-applet-audio/Cargo.toml @@ -12,7 +12,6 @@ libpulse-glib-binding = "2.25.0" tokio = { version = "1.20.1", features=["full"] } libcosmic.workspace = true cosmic-time.workspace = true -cosmic-applet = { path = "../applet" } log = "0.4.14" pretty_env_logger = "0.4.0" # Application i18n diff --git a/cosmic-applet-audio/src/localize.rs b/cosmic-applet-audio/src/localize.rs index c26b28ec..8f87ca3e 100644 --- a/cosmic-applet-audio/src/localize.rs +++ b/cosmic-applet-audio/src/localize.rs @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MPL-2.0-only +use cosmic_time::once_cell::sync::Lazy; use i18n_embed::{ fluent::{fluent_language_loader, FluentLanguageLoader}, DefaultLocalizer, LanguageLoader, Localizer, }; -use cosmic_time::once_cell::sync::Lazy; use rust_embed::RustEmbed; #[derive(RustEmbed)] diff --git a/cosmic-applet-audio/src/main.rs b/cosmic-applet-audio/src/main.rs index 1d4a7668..364d6738 100644 --- a/cosmic-applet-audio/src/main.rs +++ b/cosmic-applet-audio/src/main.rs @@ -1,26 +1,26 @@ mod localize; +use cosmic::app::Command; use cosmic::iced::widget; use cosmic::iced::Limits; use cosmic::iced_runtime::core::alignment::Horizontal; use cosmic::theme::Svg; +use cosmic::app::applet::applet_button_theme; use cosmic::widget::{button, divider, icon}; use cosmic::Renderer; -use cosmic_applet::{applet_button_theme, CosmicAppletHelper}; use cosmic::iced::{ self, widget::{column, row, slider, text}, - window, Alignment, Application, Command, Length, Subscription, + window, Alignment, Length, Subscription, }; -use cosmic::iced_style::application::{self, Appearance}; +use cosmic::iced_style::application; use cosmic::{Element, Theme}; use cosmic_time::{anim, chain, id, once_cell::sync::Lazy, Instant, Timeline}; use iced::wayland::popup::{destroy_popup, get_popup}; use iced::widget::container; -use iced::Color; mod pulse; use crate::localize::localize; @@ -33,24 +33,22 @@ pub fn main() -> cosmic::iced::Result { // Prepare i18n localize(); - let helper = CosmicAppletHelper::default(); - Audio::run(helper.window_settings()) + cosmic::app::applet::run::