From 98813824d4f7b02a84651e3a60b88f9260bead0b Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Tue, 16 Aug 2022 14:36:31 -0400 Subject: [PATCH] feat: use libcosmic::init --- Cargo.lock | 426 +++++++++++------- applets/cosmic-app-list/Cargo.toml | 2 +- .../cosmic-app-list/src/apps_container/mod.rs | 5 +- applets/cosmic-app-list/src/dock_list/mod.rs | 21 +- applets/cosmic-app-list/src/main.rs | 7 +- applets/cosmic-app-list/src/wayland.rs | 45 +- applets/cosmic-applet-audio/Cargo.toml | 2 +- applets/cosmic-applet-audio/src/input.rs | 3 +- applets/cosmic-applet-audio/src/main.rs | 8 +- applets/cosmic-applet-audio/src/output.rs | 3 +- applets/cosmic-applet-battery/Cargo.toml | 1 + applets/cosmic-applet-battery/src/main.rs | 22 +- applets/cosmic-applet-graphics/Cargo.toml | 1 + applets/cosmic-applet-graphics/src/main.rs | 7 +- applets/cosmic-applet-network/Cargo.toml | 2 +- applets/cosmic-applet-network/src/main.rs | 7 +- .../src/ui/available_wifi.rs | 2 +- .../cosmic-applet-notifications/Cargo.toml | 1 + .../cosmic-applet-notifications/src/main.rs | 5 +- applets/cosmic-applet-power/Cargo.toml | 1 + applets/cosmic-applet-power/src/main.rs | 12 +- applets/cosmic-applet-status-area/Cargo.toml | 1 + applets/cosmic-applet-status-area/src/main.rs | 5 +- applets/cosmic-applet-time/Cargo.toml | 1 + applets/cosmic-applet-time/src/main.rs | 5 +- applets/cosmic-applet-workspaces/Cargo.toml | 1 + applets/cosmic-applet-workspaces/build.rs | 2 +- .../data/resources/style.css | 7 - applets/cosmic-applet-workspaces/src/main.rs | 7 +- applets/cosmic-applet-workspaces/src/utils.rs | 1 - .../cosmic-applet-workspaces/src/wayland.rs | 22 +- .../src/workspace_list/mod.rs | 5 +- applets/cosmic-panel-button/Cargo.toml | 1 + .../src/apps_window/mod.rs | 19 +- applets/cosmic-panel-button/src/main.rs | 5 +- debian/control | 3 +- libcosmic-applet/src/button.rs | 23 +- 37 files changed, 396 insertions(+), 295 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 88b1060e..50348a24 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,24 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "adw-user-colors-lib" +version = "0.1.0" +source = "git+https://github.com/pop-os/user-color-editor#14c84d67820c6cf2b05395cfc1736e620104ec5d" +dependencies = [ + "anyhow", + "futures", + "hex", + "libadwaita", + "log", + "palette", + "pretty_env_logger", + "ron", + "serde", + "toml", + "xdg", +] + [[package]] name = "aho-corasick" version = "0.7.18" @@ -12,10 +30,28 @@ dependencies = [ ] [[package]] -name = "anyhow" -version = "1.0.58" +name = "android_system_properties" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704" +checksum = "d7ed72e1635e121ca3e79420540282af22da58be50de153d36f81ddc6b83aa9e" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "508b352bb5c066aac251f6daf6b36eccd03e8a88e8081cd44959ea277a3af9a8" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] [[package]] name = "async-broadcast" @@ -30,9 +66,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.6.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" dependencies = [ "concurrent-queue", "event-listener", @@ -109,9 +145,9 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" [[package]] name = "async-trait" -version = "0.1.56" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" +checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" dependencies = [ "proc-macro2", "quote", @@ -176,9 +212,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b3de4a0c5e67e16066a0715723abd91edc2f9001d09c46e1dca929351e130e" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "cache-padded" @@ -189,7 +225,7 @@ checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" [[package]] name = "cairo-rs" version = "0.16.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core#238cb8450b1d3a9a18d64ffd6d13d5eea35c2b2d" +source = "git+https://github.com/gtk-rs/gtk-rs-core#c53cec7cd2b9235e818680391d8613c3e4bc5504" dependencies = [ "bitflags", "cairo-sys-rs", @@ -202,7 +238,7 @@ dependencies = [ [[package]] name = "cairo-sys-rs" version = "0.16.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core#238cb8450b1d3a9a18d64ffd6d13d5eea35c2b2d" +source = "git+https://github.com/gtk-rs/gtk-rs-core#c53cec7cd2b9235e818680391d8613c3e4bc5504" dependencies = [ "glib-sys 0.16.0", "libc", @@ -251,14 +287,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" dependencies = [ - "libc", + "iana-time-zone", + "js-sys", "num-integer", "num-traits", "time 0.1.44", + "wasm-bindgen", "winapi", ] @@ -271,6 +309,12 @@ dependencies = [ "cache-padded", ] +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + [[package]] name = "cosmic-app-list" version = "0.1.0" @@ -314,8 +358,8 @@ dependencies = [ "futures-util", "gtk4", "libadwaita", + "libcosmic", "libcosmic-applet", - "libcosmic-widgets", "libpulse-binding", "libpulse-glib-binding", "mpris2-zbus", @@ -334,6 +378,7 @@ dependencies = [ "futures", "gtk4", "libadwaita", + "libcosmic", "libcosmic-applet", "relm4", "zbus", @@ -345,6 +390,7 @@ version = "0.1.0" dependencies = [ "gtk4", "libadwaita", + "libcosmic", "libcosmic-applet", "once_cell", "relm4-macros", @@ -361,8 +407,8 @@ dependencies = [ "gtk4", "itertools", "libadwaita", + "libcosmic", "libcosmic-applet", - "libcosmic-widgets", "once_cell", "relm4-macros", "slotmap", @@ -378,6 +424,7 @@ dependencies = [ "futures", "gtk4", "libadwaita", + "libcosmic", "libcosmic-applet", "once_cell", "relm4-macros", @@ -394,6 +441,7 @@ dependencies = [ "futures-util", "gtk4", "libadwaita", + "libcosmic", "libcosmic-applet", "logind-zbus", "nix 0.24.2", @@ -411,6 +459,7 @@ dependencies = [ "futures", "gtk4", "libadwaita", + "libcosmic", "libcosmic-applet", "once_cell", "serde", @@ -428,6 +477,7 @@ dependencies = [ "futures", "gtk4", "libadwaita", + "libcosmic", "libcosmic-applet", "once_cell", "serde", @@ -450,8 +500,9 @@ dependencies = [ "i18n-embed", "i18n-embed-fl", "libadwaita", + "libcosmic", "log", - "nix 0.24.2", + "nix 0.25.0", "once_cell", "pretty_env_logger", "rust-embed", @@ -467,7 +518,7 @@ dependencies = [ "bitflags", "derive_builder", "procfs", - "time 0.3.11", + "time 0.3.13", "zbus", "zvariant", ] @@ -484,6 +535,7 @@ dependencies = [ "i18n-embed", "i18n-embed-fl", "libadwaita", + "libcosmic", "once_cell", "pretty_env_logger", "rust-embed", @@ -492,7 +544,7 @@ dependencies = [ [[package]] name = "cosmic-panel-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-panel#f3947a6a3bb014782e888b5aeaebd93ee746fdcd" +source = "git+https://github.com/pop-os/cosmic-panel#1e33c751eb5795531b3ed91cc44443be2d59de36" dependencies = [ "anyhow", "gtk4", @@ -508,7 +560,7 @@ dependencies = [ [[package]] name = "cosmic-protocols" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-protocols#81d6a50bdc91af5968f87785fc19a16cf261c96b" +source = "git+https://github.com/pop-os/cosmic-protocols#3ff11df30ef551e1ccbdcb091930fe0d72266195" dependencies = [ "bitflags", "wayland-backend", @@ -820,9 +872,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +checksum = "ab30e97ab6aacfe635fad58f22c2bb06c8b685f7421eb1e064a729e2a5f481fa" dependencies = [ "futures-channel", "futures-core", @@ -835,9 +887,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +checksum = "2bfc52cbddcfd745bf1740338492bb0bd83d76c67b445f91c5fb29fae29ecaa1" dependencies = [ "futures-core", "futures-sink", @@ -845,15 +897,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" +checksum = "d2acedae88d38235936c3922476b10fced7b2b68136f5e3c03c2d5be348a1115" [[package]] name = "futures-executor" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +checksum = "1d11aa21b5b587a64682c0094c2bdd4df0076c5324961a40cc3abd7f37930528" dependencies = [ "futures-core", "futures-task", @@ -862,9 +914,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" +checksum = "93a66fc6d035a26a3ae255a6d2bca35eda63ae4c5512bef54449113f7a1228e5" [[package]] name = "futures-lite" @@ -883,9 +935,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +checksum = "0db9cce532b0eae2ccf2766ab246f114b56b9cf6d445e00c2549fbc100ca045d" dependencies = [ "proc-macro2", "quote", @@ -903,21 +955,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "ca0bae1fe9752cf7fd9b0064c674ae63f97b37bc714d745cbde0afb7ec4e6765" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "842fc63b931f4056a24d59de13fb1272134ce261816e063e634ad0c15cdc5306" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "f0828a5471e340229c11c77ca80017937ce3c58cb788a17e5f1c2d5c485a9577" dependencies = [ "futures-channel", "futures-core", @@ -934,7 +986,7 @@ dependencies = [ [[package]] name = "gdk-pixbuf" version = "0.16.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core#238cb8450b1d3a9a18d64ffd6d13d5eea35c2b2d" +source = "git+https://github.com/gtk-rs/gtk-rs-core#c53cec7cd2b9235e818680391d8613c3e4bc5504" dependencies = [ "bitflags", "gdk-pixbuf-sys", @@ -946,7 +998,7 @@ dependencies = [ [[package]] name = "gdk-pixbuf-sys" version = "0.16.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core#238cb8450b1d3a9a18d64ffd6d13d5eea35c2b2d" +source = "git+https://github.com/gtk-rs/gtk-rs-core#c53cec7cd2b9235e818680391d8613c3e4bc5504" dependencies = [ "gio-sys 0.16.0", "glib-sys 0.16.0", @@ -958,7 +1010,7 @@ dependencies = [ [[package]] name = "gdk4" version = "0.5.0" -source = "git+https://github.com/gtk-rs/gtk4-rs#4e8b6ca611e9a2d23e096eb8f7048fd9afc8c777" +source = "git+https://github.com/gtk-rs/gtk4-rs#0d74059562f80ca364f8885271f772d42a9ce697" dependencies = [ "bitflags", "cairo-rs", @@ -973,7 +1025,7 @@ dependencies = [ [[package]] name = "gdk4-sys" version = "0.5.0" -source = "git+https://github.com/gtk-rs/gtk4-rs#4e8b6ca611e9a2d23e096eb8f7048fd9afc8c777" +source = "git+https://github.com/gtk-rs/gtk4-rs#0d74059562f80ca364f8885271f772d42a9ce697" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", @@ -986,35 +1038,11 @@ dependencies = [ "system-deps", ] -[[package]] -name = "gdk4-x11" -version = "0.5.0" -source = "git+https://github.com/gtk-rs/gtk4-rs#4e8b6ca611e9a2d23e096eb8f7048fd9afc8c777" -dependencies = [ - "gdk4", - "gdk4-x11-sys", - "gio 0.16.0", - "glib 0.16.0", - "libc", - "x11", -] - -[[package]] -name = "gdk4-x11-sys" -version = "0.5.0" -source = "git+https://github.com/gtk-rs/gtk4-rs#4e8b6ca611e9a2d23e096eb8f7048fd9afc8c777" -dependencies = [ - "gdk4-sys", - "glib-sys 0.16.0", - "libc", - "system-deps", -] - [[package]] name = "generic-array" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ "typenum", "version_check", @@ -1073,7 +1101,7 @@ dependencies = [ [[package]] name = "gio" version = "0.16.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core#238cb8450b1d3a9a18d64ffd6d13d5eea35c2b2d" +source = "git+https://github.com/gtk-rs/gtk-rs-core#c53cec7cd2b9235e818680391d8613c3e4bc5504" dependencies = [ "bitflags", "futures-channel", @@ -1103,7 +1131,7 @@ dependencies = [ [[package]] name = "gio-sys" version = "0.16.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core#238cb8450b1d3a9a18d64ffd6d13d5eea35c2b2d" +source = "git+https://github.com/gtk-rs/gtk-rs-core#c53cec7cd2b9235e818680391d8613c3e4bc5504" dependencies = [ "glib-sys 0.16.0", "gobject-sys 0.16.0", @@ -1135,7 +1163,7 @@ dependencies = [ [[package]] name = "glib" version = "0.16.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core#238cb8450b1d3a9a18d64ffd6d13d5eea35c2b2d" +source = "git+https://github.com/gtk-rs/gtk-rs-core#c53cec7cd2b9235e818680391d8613c3e4bc5504" dependencies = [ "bitflags", "futures-channel", @@ -1155,7 +1183,7 @@ dependencies = [ [[package]] name = "glib-build-tools" version = "0.1.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core#238cb8450b1d3a9a18d64ffd6d13d5eea35c2b2d" +source = "git+https://github.com/gtk-rs/gtk-rs-core#c53cec7cd2b9235e818680391d8613c3e4bc5504" [[package]] name = "glib-macros" @@ -1175,7 +1203,7 @@ dependencies = [ [[package]] name = "glib-macros" version = "0.16.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core#238cb8450b1d3a9a18d64ffd6d13d5eea35c2b2d" +source = "git+https://github.com/gtk-rs/gtk-rs-core#c53cec7cd2b9235e818680391d8613c3e4bc5504" dependencies = [ "anyhow", "heck", @@ -1199,7 +1227,7 @@ dependencies = [ [[package]] name = "glib-sys" version = "0.16.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core#238cb8450b1d3a9a18d64ffd6d13d5eea35c2b2d" +source = "git+https://github.com/gtk-rs/gtk-rs-core#c53cec7cd2b9235e818680391d8613c3e4bc5504" dependencies = [ "libc", "system-deps", @@ -1219,7 +1247,7 @@ dependencies = [ [[package]] name = "gobject-sys" version = "0.16.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core#238cb8450b1d3a9a18d64ffd6d13d5eea35c2b2d" +source = "git+https://github.com/gtk-rs/gtk-rs-core#c53cec7cd2b9235e818680391d8613c3e4bc5504" dependencies = [ "glib-sys 0.16.0", "libc", @@ -1229,7 +1257,7 @@ dependencies = [ [[package]] name = "graphene-rs" version = "0.16.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core#238cb8450b1d3a9a18d64ffd6d13d5eea35c2b2d" +source = "git+https://github.com/gtk-rs/gtk-rs-core#c53cec7cd2b9235e818680391d8613c3e4bc5504" dependencies = [ "glib 0.16.0", "graphene-sys", @@ -1239,7 +1267,7 @@ dependencies = [ [[package]] name = "graphene-sys" version = "0.16.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core#238cb8450b1d3a9a18d64ffd6d13d5eea35c2b2d" +source = "git+https://github.com/gtk-rs/gtk-rs-core#c53cec7cd2b9235e818680391d8613c3e4bc5504" dependencies = [ "glib-sys 0.16.0", "libc", @@ -1250,7 +1278,7 @@ dependencies = [ [[package]] name = "gsk4" version = "0.5.0" -source = "git+https://github.com/gtk-rs/gtk4-rs#4e8b6ca611e9a2d23e096eb8f7048fd9afc8c777" +source = "git+https://github.com/gtk-rs/gtk4-rs#0d74059562f80ca364f8885271f772d42a9ce697" dependencies = [ "bitflags", "cairo-rs", @@ -1265,7 +1293,7 @@ dependencies = [ [[package]] name = "gsk4-sys" version = "0.5.0" -source = "git+https://github.com/gtk-rs/gtk4-rs#4e8b6ca611e9a2d23e096eb8f7048fd9afc8c777" +source = "git+https://github.com/gtk-rs/gtk4-rs#0d74059562f80ca364f8885271f772d42a9ce697" dependencies = [ "cairo-sys-rs", "gdk4-sys", @@ -1280,7 +1308,7 @@ dependencies = [ [[package]] name = "gtk4" version = "0.5.0" -source = "git+https://github.com/gtk-rs/gtk4-rs#4e8b6ca611e9a2d23e096eb8f7048fd9afc8c777" +source = "git+https://github.com/gtk-rs/gtk4-rs#0d74059562f80ca364f8885271f772d42a9ce697" dependencies = [ "bitflags", "cairo-rs", @@ -1302,13 +1330,12 @@ dependencies = [ [[package]] name = "gtk4-macros" version = "0.5.0" -source = "git+https://github.com/gtk-rs/gtk4-rs#4e8b6ca611e9a2d23e096eb8f7048fd9afc8c777" +source = "git+https://github.com/gtk-rs/gtk4-rs#0d74059562f80ca364f8885271f772d42a9ce697" dependencies = [ "anyhow", "proc-macro-crate", "proc-macro-error", "proc-macro2", - "quick-xml", "quote", "syn", ] @@ -1316,7 +1343,7 @@ dependencies = [ [[package]] name = "gtk4-sys" version = "0.5.0" -source = "git+https://github.com/gtk-rs/gtk4-rs#4e8b6ca611e9a2d23e096eb8f7048fd9afc8c777" +source = "git+https://github.com/gtk-rs/gtk4-rs#0d74059562f80ca364f8885271f772d42a9ce697" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", @@ -1436,6 +1463,19 @@ dependencies = [ "syn", ] +[[package]] +name = "iana-time-zone" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef5528d9c2817db4e10cc78f8d4c8228906e5854f389ff6b076cee3572a09d35" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "js-sys", + "wasm-bindgen", + "winapi", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1482,9 +1522,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" +checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" [[package]] name = "js-sys" @@ -1534,24 +1574,22 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.126" +version = "0.2.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic?branch=relm4-next#851449c3ef8fc7c209ca857ec8645160d055c9ae" +source = "git+https://github.com/pop-os/libcosmic#8485b82e9ec74b5d51ca83625e786f9c34b60a4b" dependencies = [ + "adw-user-colors-lib", "cascade", - "gdk4", - "gdk4-x11", - "gio 0.16.0", - "gobject-sys 0.16.0", "gtk4", + "libadwaita", "libcosmic-widgets", "once_cell", - "x11", + "xdg", ] [[package]] @@ -1567,7 +1605,7 @@ dependencies = [ [[package]] name = "libcosmic-widgets" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic?branch=relm4-next#851449c3ef8fc7c209ca857ec8645160d055c9ae" +source = "git+https://github.com/pop-os/libcosmic#8485b82e9ec74b5d51ca83625e786f9c34b60a4b" dependencies = [ "relm4", "relm4-macros", @@ -1716,11 +1754,11 @@ dependencies = [ [[package]] name = "mpris2-zbus" version = "0.1.0" -source = "git+https://github.com/pop-os/mpris2-zbus#bcc8481ea7ccfc08aa870f28272d9093db3b1ba9" +source = "git+https://github.com/pop-os/mpris2-zbus#4e853c5a62a8a89ce58af11daddb62427523bc07" dependencies = [ "serde", "thiserror", - "time 0.3.11", + "time 0.3.13", "zbus", "zvariant", ] @@ -1772,6 +1810,20 @@ dependencies = [ "memoffset", ] +[[package]] +name = "nix" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb" +dependencies = [ + "autocfg", + "bitflags", + "cfg-if", + "libc", + "memoffset", + "pin-utils", +] + [[package]] name = "num-derive" version = "0.3.3" @@ -1852,9 +1904,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" +checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e" [[package]] name = "opaque-debug" @@ -1872,10 +1924,35 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "palette" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f9cd68f7112581033f157e56c77ac4a5538ec5836a2e39284e65bd7d7275e49" +dependencies = [ + "approx", + "num-traits", + "palette_derive", + "phf", + "serde", +] + +[[package]] +name = "palette_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05eedf46a8e7c27f74af0c9cfcdb004ceca158cb1b918c6f68f8d7a549b3e427" +dependencies = [ + "find-crate", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pango" version = "0.16.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core#238cb8450b1d3a9a18d64ffd6d13d5eea35c2b2d" +source = "git+https://github.com/gtk-rs/gtk-rs-core#c53cec7cd2b9235e818680391d8613c3e4bc5504" dependencies = [ "bitflags", "gio 0.16.0", @@ -1888,7 +1965,7 @@ dependencies = [ [[package]] name = "pango-sys" version = "0.16.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core#238cb8450b1d3a9a18d64ffd6d13d5eea35c2b2d" +source = "git+https://github.com/gtk-rs/gtk-rs-core#c53cec7cd2b9235e818680391d8613c3e4bc5504" dependencies = [ "glib-sys 0.16.0", "gobject-sys 0.16.0", @@ -1927,27 +2004,70 @@ dependencies = [ [[package]] name = "pest" -version = "2.1.3" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +checksum = "69486e2b8c2d2aeb9762db7b4e00b0331156393555cff467f4163ff06821eef8" dependencies = [ + "thiserror", "ucd-trie", ] [[package]] -name = "pin-project" -version = "1.0.11" +name = "phf" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260" +checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92aacdc5f16768709a569e913f7451034034178b05bdc8acda226659a3dccc66" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "phf_shared" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", @@ -2003,10 +2123,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.1.3" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" dependencies = [ + "once_cell", "thiserror", "toml", ] @@ -2037,9 +2158,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.42" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c278e965f1d8cf32d6e0e96de3d3e79712178ae67986d9cf9151f51e95aac89b" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" dependencies = [ "unicode-ident", ] @@ -2063,20 +2184,11 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" -[[package]] -name = "quick-xml" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8533f14c8382aaad0d592c812ac3b826162128b65662331e1127b45c3d18536b" -dependencies = [ - "memchr", -] - [[package]] name = "quote" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] @@ -2151,7 +2263,7 @@ checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "relm4" version = "0.5.0-beta.1" -source = "git+https://github.com/relm4/relm4?branch=next#a7d2432997f68ac4682e0c9f2ed58ab2c2b8cd1a" +source = "git+https://github.com/relm4/relm4?branch=next#55231e300ce9e2b51d66f078b7759eba0759537c" dependencies = [ "async-broadcast", "async-oneshot", @@ -2168,7 +2280,7 @@ dependencies = [ [[package]] name = "relm4-macros" version = "0.5.0-beta.1" -source = "git+https://github.com/relm4/relm4?branch=next#a7d2432997f68ac4682e0c9f2ed58ab2c2b8cd1a" +source = "git+https://github.com/relm4/relm4?branch=next#55231e300ce9e2b51d66f078b7759eba0759537c" dependencies = [ "proc-macro2", "quote", @@ -2246,9 +2358,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" [[package]] name = "same-file" @@ -2297,18 +2409,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.140" +version = "1.0.143" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" +checksum = "53e8e5d5b70924f74ff5c6d64d9a5acd91422117c60f48c4e07855238a254553" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.140" +version = "1.0.143" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" +checksum = "d3d8e8de557aee63c26b85b947f5e59b690d0454c753f3adeb5cd7835ab88391" dependencies = [ "proc-macro2", "quote", @@ -2317,9 +2429,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" +checksum = "38dd04e3c8279e75b31ef29dbdceebfe5ad89f4d0937213c53f7d49d01b3d5a7" dependencies = [ "itoa", "ryu", @@ -2328,9 +2440,9 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ad84e47328a31223de7fed7a4f5087f2d6ddfe586cf3ca25b7a165bc0a5aed" +checksum = "1fe39d9fbb0ebf5eb2c7cb7e2a47e4f462fad1379f1166b8ae49ad9eae89a7ca" dependencies = [ "proc-macro2", "quote", @@ -2374,6 +2486,12 @@ dependencies = [ "libc", ] +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + [[package]] name = "slab" version = "0.4.7" @@ -2437,9 +2555,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.98" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" dependencies = [ "proc-macro2", "quote", @@ -2490,18 +2608,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.31" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.31" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" dependencies = [ "proc-macro2", "quote", @@ -2521,9 +2639,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.11" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" +checksum = "db76ff9fa4b1458b3c7f077f3ff9887394058460d21e634355b273aaf11eea45" dependencies = [ "libc", "num_threads", @@ -2578,9 +2696,9 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.35" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" +checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" dependencies = [ "cfg-if", "log", @@ -2602,9 +2720,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7" +checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" dependencies = [ "once_cell", ] @@ -2681,9 +2799,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" +checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" [[package]] name = "vec_map" @@ -2992,16 +3110,6 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" -[[package]] -name = "x11" -version = "2.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd0565fa8bfba8c5efe02725b14dff114c866724eff2cfd44d76cea74bcd87a" -dependencies = [ - "libc", - "pkg-config", -] - [[package]] name = "xdg" version = "2.4.1" @@ -3014,7 +3122,7 @@ dependencies = [ [[package]] name = "xdg-shell-wrapper-config" version = "0.1.0" -source = "git+https://github.com/pop-os/xdg-shell-wrapper#17681887315f260e25f699d5ed538aa4e564d935" +source = "git+https://github.com/pop-os/xdg-shell-wrapper#d6f721da1d6d38cc8f501e57a82c5099a8bd4af0" dependencies = [ "serde", "wayland-protocols 0.29.4", diff --git a/applets/cosmic-app-list/Cargo.toml b/applets/cosmic-app-list/Cargo.toml index 8e1a0d2e..5eb81d4b 100644 --- a/applets/cosmic-app-list/Cargo.toml +++ b/applets/cosmic-app-list/Cargo.toml @@ -10,8 +10,8 @@ cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols", default cascade = "1.0.0" gtk4 = { git = "https://github.com/gtk-rs/gtk4-rs", features = ["v4_4"] } adw = { git = "https://gitlab.gnome.org/World/Rust/libadwaita-rs", package = "libadwaita"} +libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false } gio = { git = "https://github.com/gtk-rs/gtk-rs-core" } -libcosmic = { git = "https://github.com/pop-os/libcosmic", branch = "relm4-next" } relm4-macros = { git = "https://github.com/Relm4/Relm4.git", branch = "next" } serde_json = "1.0.78" futures = "0.3.19" diff --git a/applets/cosmic-app-list/src/apps_container/mod.rs b/applets/cosmic-app-list/src/apps_container/mod.rs index 3b39f76c..1d9e416d 100644 --- a/applets/cosmic-app-list/src/apps_container/mod.rs +++ b/applets/cosmic-app-list/src/apps_container/mod.rs @@ -54,7 +54,10 @@ impl AppsContainer { imp.active_list.set(active_app_list_view).unwrap(); // Setup self_.setup_callbacks(); - let anchor = std::env::var("COSMIC_PANEL_ANCHOR").ok().and_then(|anchor| anchor.parse::().ok()).unwrap_or_default(); + let anchor = std::env::var("COSMIC_PANEL_ANCHOR") + .ok() + .and_then(|anchor| anchor.parse::().ok()) + .unwrap_or_default(); self_.set_position(anchor); Self::setup_callbacks(&self_); diff --git a/applets/cosmic-app-list/src/dock_list/mod.rs b/applets/cosmic-app-list/src/dock_list/mod.rs index e2ec233d..42ad4c21 100644 --- a/applets/cosmic-app-list/src/dock_list/mod.rs +++ b/applets/cosmic-app-list/src/dock_list/mod.rs @@ -500,15 +500,18 @@ impl DockList { let factory = SignalListItemFactory::new(); let model = imp.model.get().expect("Failed to get saved app model."); - let icon_size = std::env::var("COSMIC_PANEL_SIZE").ok().and_then(|size| match size.parse::() { - Ok(PanelSize::XL) => Some(64), - Ok(PanelSize::L) => Some(48), - Ok(PanelSize::M) => Some(36), - Ok(PanelSize::S) => Some(24), - Ok(PanelSize::XS) => Some(18), - Err(_) => Some(36), - }).unwrap_or(36); - + let icon_size = std::env::var("COSMIC_PANEL_SIZE") + .ok() + .and_then(|size| match size.parse::() { + Ok(PanelSize::XL) => Some(64), + Ok(PanelSize::L) => Some(48), + Ok(PanelSize::M) => Some(36), + Ok(PanelSize::S) => Some(24), + Ok(PanelSize::XS) => Some(18), + Err(_) => Some(36), + }) + .unwrap_or(36); + factory.connect_setup( glib::clone!(@weak popover_menu_index, @weak model => move |_, list_item| { let dock_item = DockItem::new(icon_size); diff --git a/applets/cosmic-app-list/src/main.rs b/applets/cosmic-app-list/src/main.rs index 1b9da460..325ecdb3 100644 --- a/applets/cosmic-app-list/src/main.rs +++ b/applets/cosmic-app-list/src/main.rs @@ -49,9 +49,8 @@ fn load_css() { } fn main() { - let _ = gtk4::init(); - adw::init(); - + let _ = libcosmic::init(); + // Initialize logger pretty_env_logger::init(); glib::set_application_name("Cosmic Dock App List"); @@ -243,7 +242,7 @@ fn main() { dock_obj.set_property("active", BoxedWindowList::default().to_value()); saved_app_model.items_changed(saved_i, 0, 0); } - + if let Some(cur_app_info) = dock_obj.property::>("appinfo") { diff --git a/applets/cosmic-app-list/src/wayland.rs b/applets/cosmic-app-list/src/wayland.rs index ecb22baf..19fd724e 100644 --- a/applets/cosmic-app-list/src/wayland.rs +++ b/applets/cosmic-app-list/src/wayland.rs @@ -1,7 +1,7 @@ use crate::config::AppListConfig; use crate::{config::TopLevelFilter, utils::AppListEvent, wayland_source::WaylandSource, TX}; use calloop::channel::*; -use cosmic_panel_config::{CosmicPanelOuput}; +use cosmic_panel_config::CosmicPanelOuput; use cosmic_protocols::{ toplevel_info::v1::client::{ zcosmic_toplevel_handle_v1::{self, ZcosmicToplevelHandleV1}, @@ -52,10 +52,12 @@ pub fn spawn_toplevels() -> SyncSender { .and_then(|s| s.map(|s| Connection::from_socket(s).map_err(anyhow::Error::msg))) { std::thread::spawn(move || { - let output = std::env::var("COSMIC_PANEL_OUTPUT").ok().and_then(|size| match size.parse::() { - Ok(CosmicPanelOuput::Name(n)) => Some(n), - // TODO handle Active & panic if the space is still configured for All instead of being assigned a named output - _ => None, + let output = std::env::var("COSMIC_PANEL_OUTPUT").ok().and_then(|size| { + match size.parse::() { + Ok(CosmicPanelOuput::Name(n)) => Some(n), + // TODO handle Active & panic if the space is still configured for All instead of being assigned a named output + _ => None, + } }); let mut event_loop = calloop::EventLoop::::try_new().unwrap(); @@ -305,26 +307,25 @@ impl Dispatch for State { if let Some(i) = state.toplevels.iter().position(|t| &t.toplevel_handle == p) { let removed_toplevel = state.toplevels.remove(i); if match state.config.filter_top_levels { - Some(TopLevelFilter::ActiveWorkspace) => { - state - .workspace_groups - .iter() - .find(|g| { - g.workspaces - .iter() - .find(|w| { - w.states.contains( - &zcosmic_workspace_handle_v1::State::Active, - ) && Some(&w.workspace_handle) == removed_toplevel.workspace.as_ref() - }) - .is_some() - }) - .is_some() - }, + Some(TopLevelFilter::ActiveWorkspace) => state + .workspace_groups + .iter() + .find(|g| { + g.workspaces + .iter() + .find(|w| { + w.states + .contains(&zcosmic_workspace_handle_v1::State::Active) + && Some(&w.workspace_handle) + == removed_toplevel.workspace.as_ref() + }) + .is_some() + }) + .is_some(), Some(TopLevelFilter::ConfiguredOutput) => { state.expected_output == removed_toplevel.output } - _ => true + _ => true, } { let tx = TX.get().unwrap().clone(); let _ = tx.send(AppListEvent::Remove(removed_toplevel)); diff --git a/applets/cosmic-applet-audio/Cargo.toml b/applets/cosmic-applet-audio/Cargo.toml index f43ad86e..ce930f58 100644 --- a/applets/cosmic-applet-audio/Cargo.toml +++ b/applets/cosmic-applet-audio/Cargo.toml @@ -8,7 +8,6 @@ license = "GPL-3.0-or-later" futures = "0.3.21" futures-util = "0.3.21" libcosmic-applet = { path = "../../libcosmic-applet" } -libcosmic-widgets = { git = "https://github.com/pop-os/libcosmic", branch = "relm4-next" } libpulse-binding = "2.26.0" libpulse-glib-binding = "2.25.0" tracker = "0.1.1" @@ -21,6 +20,7 @@ relm4-macros = { git = "https://github.com/relm4/relm4", branch = "next" } once_cell = "1.10.0" gtk4 = { git = "https://github.com/gtk-rs/gtk4-rs", features = ["v4_2"] } adw = { git = "https://gitlab.gnome.org/World/Rust/libadwaita-rs", package = "libadwaita"} +libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false, features = ["widgets"] } async-io = "1.6.0" [features] diff --git a/applets/cosmic-applet-audio/src/input.rs b/applets/cosmic-applet-audio/src/input.rs index 4975f700..258b5189 100644 --- a/applets/cosmic-applet-audio/src/input.rs +++ b/applets/cosmic-applet-audio/src/input.rs @@ -1,6 +1,5 @@ use gtk4::{glib::clone, prelude::*, Button, Label, ListBox}; -use libcosmic_widgets::{relm4::RelmContainerExt, LabeledItem}; -use std::rc::Rc; +use libcosmic::widgets::{relm4::RelmContainerExt, LabeledItem}; use crate::pa::{DeviceInfo, PA}; diff --git a/applets/cosmic-applet-audio/src/main.rs b/applets/cosmic-applet-audio/src/main.rs index a5dccf8e..c800ef18 100644 --- a/applets/cosmic-applet-audio/src/main.rs +++ b/applets/cosmic-applet-audio/src/main.rs @@ -36,12 +36,8 @@ use tokio::runtime::Runtime; static RT: Lazy = Lazy::new(|| Runtime::new().expect("failed to build tokio runtime")); fn main() { - let _ = gtk4::init(); - adw::init(); - let application = Application::new( - None, - ApplicationFlags::default(), - ); + let _ = libcosmic::init(); + let application = Application::new(None, ApplicationFlags::default()); application.connect_activate(app); application.run(); } diff --git a/applets/cosmic-applet-audio/src/output.rs b/applets/cosmic-applet-audio/src/output.rs index f05bd94f..72bc5ba6 100644 --- a/applets/cosmic-applet-audio/src/output.rs +++ b/applets/cosmic-applet-audio/src/output.rs @@ -1,6 +1,5 @@ use gtk4::{glib::clone, prelude::*, Button, Label, ListBox}; -use libcosmic_widgets::{relm4::RelmContainerExt, LabeledItem}; -use std::rc::Rc; +use libcosmic::widgets::{relm4::RelmContainerExt, LabeledItem}; use crate::pa::{DeviceInfo, PA}; diff --git a/applets/cosmic-applet-battery/Cargo.toml b/applets/cosmic-applet-battery/Cargo.toml index 6d2cc3c1..b3254e4a 100644 --- a/applets/cosmic-applet-battery/Cargo.toml +++ b/applets/cosmic-applet-battery/Cargo.toml @@ -7,6 +7,7 @@ edition = "2021" futures = "0.3" gtk4 = { git = "https://github.com/gtk-rs/gtk4-rs" } adw = { git = "https://gitlab.gnome.org/World/Rust/libadwaita-rs", package = "libadwaita"} +libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false } libcosmic-applet = { path = "../../libcosmic-applet" } relm4 = { git = "https://github.com/relm4/relm4", branch = "next", features = ["macros"] } zbus = { version = "2", no-default-features = true } diff --git a/applets/cosmic-applet-battery/src/main.rs b/applets/cosmic-applet-battery/src/main.rs index 8c7876ab..84afab33 100644 --- a/applets/cosmic-applet-battery/src/main.rs +++ b/applets/cosmic-applet-battery/src/main.rs @@ -2,9 +2,11 @@ // TODO: handle dbus service start/stop? use futures::prelude::*; -use gtk4::{glib, prelude::*, gio::ApplicationFlags, Application}; -use relm4::{ComponentParts, ComponentSender, RelmApp, SimpleComponent}; -use std::{process::Command, time::Duration}; +use gtk4::{gio::ApplicationFlags, glib, prelude::*, Application}; +use relm4::{ + component::ComponentSenderInner, ComponentParts, ComponentSender, RelmApp, SimpleComponent, +}; +use std::{process::Command, sync::Arc, time::Duration}; mod backlight; use backlight::{backlight, Backlight, LogindSessionProxy}; @@ -198,7 +200,7 @@ impl SimpleComponent for AppModel { fn init( _params: Self::InitParams, root: &Self::Root, - sender: &ComponentSender, + sender: Arc>, ) -> ComponentParts { let mut model = AppModel { icon_name: "battery-symbolic".to_string(), @@ -253,7 +255,7 @@ impl SimpleComponent for AppModel { ComponentParts { model, widgets } } - fn update(&mut self, msg: Self::Input, sender: &ComponentSender) { + fn update(&mut self, msg: Self::Input, sender: Arc>) { match msg { AppMsg::SetDisplayBrightness(value) => { self.display_brightness = value; @@ -357,12 +359,8 @@ impl SimpleComponent for AppModel { } fn main() { - let _ = gtk4::init(); - adw::init(); - - let app = RelmApp::with_app(Application::new( - None, - ApplicationFlags::default(), - )); + let _ = libcosmic::init(); + + let app = RelmApp::with_app(Application::new(None, ApplicationFlags::default())); app.run::(()); } diff --git a/applets/cosmic-applet-graphics/Cargo.toml b/applets/cosmic-applet-graphics/Cargo.toml index 129a83dd..c3bf6b97 100644 --- a/applets/cosmic-applet-graphics/Cargo.toml +++ b/applets/cosmic-applet-graphics/Cargo.toml @@ -8,6 +8,7 @@ edition = "2021" [dependencies] gtk4 = { git = "https://github.com/gtk-rs/gtk4-rs", features = ["v4_2"] } adw = { git = "https://gitlab.gnome.org/World/Rust/libadwaita-rs", package = "libadwaita"} +libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false } libcosmic-applet = { path = "../../libcosmic-applet" } once_cell = "1.9.0" relm4-macros = { git = "https://github.com/Relm4/Relm4.git", branch = "next" } diff --git a/applets/cosmic-applet-graphics/src/main.rs b/applets/cosmic-applet-graphics/src/main.rs index 7985b077..9448d6d0 100644 --- a/applets/cosmic-applet-graphics/src/main.rs +++ b/applets/cosmic-applet-graphics/src/main.rs @@ -41,9 +41,8 @@ fn row_clicked(_: &ListBox, row: &ListBoxRow) { } fn main() { - let _ = gtk4::init(); - adw::init(); - + let _ = libcosmic::init(); + let provider = gtk4::CssProvider::new(); provider.load_from_data(include_bytes!("style.css")); gtk4::StyleContext::add_provider_for_display( @@ -63,7 +62,7 @@ fn main() { set_title: Some("COSMIC Graphics Applet"), #[wrap(Some)] set_child = &libcosmic_applet::AppletButton { - set_button_icon_name: "input-gaming", + set_button_icon_name: "input-gaming-symbolic", #[wrap(Some)] set_popover_child: main_overlay = &Overlay { add_overlay: loading_box = >k4::Box { diff --git a/applets/cosmic-applet-network/Cargo.toml b/applets/cosmic-applet-network/Cargo.toml index eec0ccf4..c10f090e 100644 --- a/applets/cosmic-applet-network/Cargo.toml +++ b/applets/cosmic-applet-network/Cargo.toml @@ -9,6 +9,7 @@ cosmic-dbus-networkmanager = { git = "https://github.com/pop-os/dbus-settings-bi futures-util = "0.3.21" gtk4 = { git = "https://github.com/gtk-rs/gtk4-rs" } adw = { git = "https://gitlab.gnome.org/World/Rust/libadwaita-rs", package = "libadwaita"} +libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false, features = ["widgets"] } itertools = "0.10.3" once_cell = "1.9.0" relm4-macros = { git = "https://github.com/Relm4/Relm4.git", branch = "next" } @@ -16,4 +17,3 @@ slotmap = "1.0.6" tokio = { version = "1.15.0", features = ["full"] } zbus = "2.0.1" libcosmic-applet = { path = "../../libcosmic-applet" } -libcosmic-widgets = { git = "https://github.com/pop-os/libcosmic", branch = "relm4-next" } diff --git a/applets/cosmic-applet-network/src/main.rs b/applets/cosmic-applet-network/src/main.rs index 90b61464..4cbd1ae2 100644 --- a/applets/cosmic-applet-network/src/main.rs +++ b/applets/cosmic-applet-network/src/main.rs @@ -14,15 +14,14 @@ use tokio::runtime::Runtime; static RT: Lazy = Lazy::new(|| Runtime::new().expect("failed to build tokio runtime")); fn main() { - let _ = gtk4::init(); - adw::init(); - + let _ = libcosmic::init(); + view! { window = libcosmic_applet::AppletWindow { set_title: Some("COSMIC Network Applet"), #[wrap(Some)] set_child: button = &libcosmic_applet::AppletButton { - set_button_icon_name: "preferences-system-network", + set_button_icon_name: "network-workgroup-symbolic", #[wrap(Some)] set_popover_child: main_box = >k4::Box { set_orientation: Orientation::Vertical, diff --git a/applets/cosmic-applet-network/src/ui/available_wifi.rs b/applets/cosmic-applet-network/src/ui/available_wifi.rs index f316e96d..7b9b247d 100644 --- a/applets/cosmic-applet-network/src/ui/available_wifi.rs +++ b/applets/cosmic-applet-network/src/ui/available_wifi.rs @@ -11,7 +11,7 @@ use gtk4::{ prelude::*, Image, ListBox, ListBoxRow, Separator, }; -use libcosmic_widgets::{relm4::RelmContainerExt, LabeledItem}; +use libcosmic::widgets::{relm4::RelmContainerExt, LabeledItem}; use std::{ cell::RefCell, collections::{BTreeMap, HashMap}, diff --git a/applets/cosmic-applet-notifications/Cargo.toml b/applets/cosmic-applet-notifications/Cargo.toml index 24b4317c..5ca4c6a8 100644 --- a/applets/cosmic-applet-notifications/Cargo.toml +++ b/applets/cosmic-applet-notifications/Cargo.toml @@ -9,6 +9,7 @@ cascade = "1" futures = "0.3" gtk4 = { git = "https://github.com/gtk-rs/gtk4-rs" } adw = { git = "https://gitlab.gnome.org/World/Rust/libadwaita-rs", package = "libadwaita"} +libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false } libcosmic-applet = { path = "../../libcosmic-applet" } once_cell = "1.12" relm4-macros = { git = "https://github.com/Relm4/Relm4.git", branch = "next" } diff --git a/applets/cosmic-applet-notifications/src/main.rs b/applets/cosmic-applet-notifications/src/main.rs index 116d8542..643ea72a 100644 --- a/applets/cosmic-applet-notifications/src/main.rs +++ b/applets/cosmic-applet-notifications/src/main.rs @@ -12,9 +12,8 @@ mod notifications; use notifications::Notifications; fn main() { - let _ = gtk4::init(); - adw::init(); - + let _ = libcosmic::init(); + // XXX Implement DBus service somewhere other than applet? let notifications = Notifications::new(); diff --git a/applets/cosmic-applet-power/Cargo.toml b/applets/cosmic-applet-power/Cargo.toml index 030259ec..b0edf3a8 100644 --- a/applets/cosmic-applet-power/Cargo.toml +++ b/applets/cosmic-applet-power/Cargo.toml @@ -8,6 +8,7 @@ license = "GPL-3.0-or-later" futures-util = "0.3.21" gtk4 = { git = "https://github.com/gtk-rs/gtk4-rs" } adw = { git = "https://gitlab.gnome.org/World/Rust/libadwaita-rs", package = "libadwaita"} +libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false } libcosmic-applet = { path = "../../libcosmic-applet" } logind-zbus = "3.0.1" nix = "0.24.1" diff --git a/applets/cosmic-applet-power/src/main.rs b/applets/cosmic-applet-power/src/main.rs index 6316637e..cdda9abb 100644 --- a/applets/cosmic-applet-power/src/main.rs +++ b/applets/cosmic-applet-power/src/main.rs @@ -3,9 +3,9 @@ #[macro_use] extern crate relm4_macros; +pub mod cosmic_session; pub mod session_manager; pub mod ui; -pub mod cosmic_session; use gtk4::{gio::ApplicationFlags, prelude::*, Align, Button, Label, Orientation, Separator}; use once_cell::sync::Lazy; @@ -15,13 +15,9 @@ use tokio::runtime::Runtime; static RT: Lazy = Lazy::new(|| Runtime::new().expect("failed to build tokio runtime")); fn main() { - let _ = gtk4::init(); - adw::init(); - - let application = gtk4::Application::new( - None, - ApplicationFlags::default(), - ); + let _ = libcosmic::init(); + + let application = gtk4::Application::new(None, ApplicationFlags::default()); application.connect_activate(build_ui); application.run(); } diff --git a/applets/cosmic-applet-status-area/Cargo.toml b/applets/cosmic-applet-status-area/Cargo.toml index 317b043f..bf33d334 100644 --- a/applets/cosmic-applet-status-area/Cargo.toml +++ b/applets/cosmic-applet-status-area/Cargo.toml @@ -9,6 +9,7 @@ cascade = "1" futures = "0.3" gtk4 = { git = "https://github.com/gtk-rs/gtk4-rs" } adw = { git = "https://gitlab.gnome.org/World/Rust/libadwaita-rs", package = "libadwaita"} +libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false } libcosmic-applet = { path = "../../libcosmic-applet" } once_cell = "1.12" serde = "1" diff --git a/applets/cosmic-applet-status-area/src/main.rs b/applets/cosmic-applet-status-area/src/main.rs index d3f55b93..f7de83b5 100644 --- a/applets/cosmic-applet-status-area/src/main.rs +++ b/applets/cosmic-applet-status-area/src/main.rs @@ -10,9 +10,8 @@ mod status_notifier_watcher; use status_area::StatusArea; fn main() { - let _ = gtk4::init(); - adw::init(); - + let _ = libcosmic::init(); + // XXX Implement DBus service somewhere other than applet? glib::MainContext::default().spawn_local(status_notifier_watcher::start()); diff --git a/applets/cosmic-applet-time/Cargo.toml b/applets/cosmic-applet-time/Cargo.toml index 4e9edf20..e20fe508 100644 --- a/applets/cosmic-applet-time/Cargo.toml +++ b/applets/cosmic-applet-time/Cargo.toml @@ -10,6 +10,7 @@ chrono = "0.4" futures = "0.3" gtk4 = { git = "https://github.com/gtk-rs/gtk4-rs", features = [ "v4_6" ] } adw = { git = "https://gitlab.gnome.org/World/Rust/libadwaita-rs", package = "libadwaita"} +libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false } libcosmic-applet = { path = "../../libcosmic-applet" } once_cell = "1.12" serde = "1" diff --git a/applets/cosmic-applet-time/src/main.rs b/applets/cosmic-applet-time/src/main.rs index 1cf5b4c7..3fc8e352 100644 --- a/applets/cosmic-applet-time/src/main.rs +++ b/applets/cosmic-applet-time/src/main.rs @@ -6,9 +6,8 @@ mod time_button; use time_button::TimeButton; fn main() { - let _ = gtk4::init(); - adw::init(); - + let _ = libcosmic::init(); + cascade! { libcosmic_applet::AppletWindow::new(); ..set_child(Some(&TimeButton::new())); diff --git a/applets/cosmic-applet-workspaces/Cargo.toml b/applets/cosmic-applet-workspaces/Cargo.toml index a3928e9a..b29eb25b 100644 --- a/applets/cosmic-applet-workspaces/Cargo.toml +++ b/applets/cosmic-applet-workspaces/Cargo.toml @@ -12,6 +12,7 @@ cosmic-panel-config = { git = "https://github.com/pop-os/cosmic-panel", features cascade = "1.0.0" gtk4 = { git = "https://github.com/gtk-rs/gtk4-rs", features = ["v4_4"] } adw = { git = "https://gitlab.gnome.org/World/Rust/libadwaita-rs", package = "libadwaita"} +libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false } once_cell = "1.9.0" pretty_env_logger = "0.4" anyhow = "1.0.50" diff --git a/applets/cosmic-applet-workspaces/build.rs b/applets/cosmic-applet-workspaces/build.rs index 3d9eff82..b589a5d8 100644 --- a/applets/cosmic-applet-workspaces/build.rs +++ b/applets/cosmic-applet-workspaces/build.rs @@ -1,4 +1,4 @@ -use std::{process::Command}; +use std::process::Command; fn main() { if let Some(output) = Command::new("git") diff --git a/applets/cosmic-applet-workspaces/data/resources/style.css b/applets/cosmic-applet-workspaces/data/resources/style.css index e79e1ddb..a1ed808f 100644 --- a/applets/cosmic-applet-workspaces/data/resources/style.css +++ b/applets/cosmic-applet-workspaces/data/resources/style.css @@ -1,10 +1,3 @@ -@define-color accent_color #001d6b; -@define-color destructive_color #aa3000; -@define-color view_bg_color #00000044; -@define-color destructive_fg_color white; -@define-color accent_fg_color white; -@define-color view_fg_color white; - button.alert { border-radius: 0; padding: 0px; diff --git a/applets/cosmic-applet-workspaces/src/main.rs b/applets/cosmic-applet-workspaces/src/main.rs index a1e457f0..8b8a2fcf 100644 --- a/applets/cosmic-applet-workspaces/src/main.rs +++ b/applets/cosmic-applet-workspaces/src/main.rs @@ -9,7 +9,7 @@ use gtk4::{ CssProvider, StyleContext, }; use once_cell::sync::OnceCell; -use utils::{WorkspaceEvent}; +use utils::WorkspaceEvent; use window::CosmicWorkspacesWindow; mod localize; @@ -45,9 +45,8 @@ fn load_css() { } fn main() { - let _ = gtk4::init(); - adw::init(); - + let _ = libcosmic::init(); + // Initialize logger pretty_env_logger::init(); glib::set_application_name(ID); diff --git a/applets/cosmic-applet-workspaces/src/utils.rs b/applets/cosmic-applet-workspaces/src/utils.rs index 1310cd9a..0b0db142 100644 --- a/applets/cosmic-applet-workspaces/src/utils.rs +++ b/applets/cosmic-applet-workspaces/src/utils.rs @@ -5,7 +5,6 @@ use std::path::PathBuf; use gtk4::glib; use std::future::Future; - #[derive(Debug, Clone)] pub enum WorkspaceEvent { Activate(String), diff --git a/applets/cosmic-applet-workspaces/src/wayland.rs b/applets/cosmic-applet-workspaces/src/wayland.rs index b211d8b0..027f4552 100644 --- a/applets/cosmic-applet-workspaces/src/wayland.rs +++ b/applets/cosmic-applet-workspaces/src/wayland.rs @@ -1,7 +1,4 @@ -use crate::{ - utils::WorkspaceEvent, - wayland_source::WaylandSource, -}; +use crate::{utils::WorkspaceEvent, wayland_source::WaylandSource}; use calloop::channel::*; use cosmic_panel_config::CosmicPanelOuput; use cosmic_protocols::workspace::v1::client::{ @@ -10,9 +7,7 @@ use cosmic_protocols::workspace::v1::client::{ zcosmic_workspace_manager_v1::{self, ZcosmicWorkspaceManagerV1}, }; use gtk4::glib; -use std::{ - env, os::unix::net::UnixStream, path::PathBuf, time::Duration, -}; +use std::{env, os::unix::net::UnixStream, path::PathBuf, time::Duration}; use wayland_client::{ event_created_child, protocol::{ @@ -39,11 +34,14 @@ pub fn spawn_workspaces(tx: glib::Sender) -> SyncSender { .and_then(|s| s.map(|s| Connection::from_socket(s).map_err(anyhow::Error::msg))) { std::thread::spawn(move || { - let output = std::env::var("COSMIC_PANEL_OUTPUT").ok().and_then(|size| match size.parse::() { - Ok(CosmicPanelOuput::Name(n)) => Some(n), - // TODO handle Active & panic if the space is still configured for All instead of being assigned a named output - _ => Some("".to_string()), - }).unwrap_or_default(); + let output = std::env::var("COSMIC_PANEL_OUTPUT") + .ok() + .and_then(|size| match size.parse::() { + Ok(CosmicPanelOuput::Name(n)) => Some(n), + // TODO handle Active & panic if the space is still configured for All instead of being assigned a named output + _ => Some("".to_string()), + }) + .unwrap_or_default(); let mut event_loop = calloop::EventLoop::::try_new().unwrap(); let loop_handle = event_loop.handle(); diff --git a/applets/cosmic-applet-workspaces/src/workspace_list/mod.rs b/applets/cosmic-applet-workspaces/src/workspace_list/mod.rs index 68ea9fe3..1f107847 100644 --- a/applets/cosmic-applet-workspaces/src/workspace_list/mod.rs +++ b/applets/cosmic-applet-workspaces/src/workspace_list/mod.rs @@ -41,7 +41,10 @@ impl WorkspaceList { fn layout(&self) { let imp = imp::WorkspaceList::from_instance(self); - let anchor = std::env::var("COSMIC_PANEL_ANCHOR").ok().and_then(|anchor| anchor.parse::().ok()).unwrap_or_default(); + let anchor = std::env::var("COSMIC_PANEL_ANCHOR") + .ok() + .and_then(|anchor| anchor.parse::().ok()) + .unwrap_or_default(); let list_view = cascade! { ListView::default(); diff --git a/applets/cosmic-panel-button/Cargo.toml b/applets/cosmic-panel-button/Cargo.toml index 8655f509..b6e3c8cb 100644 --- a/applets/cosmic-panel-button/Cargo.toml +++ b/applets/cosmic-panel-button/Cargo.toml @@ -9,6 +9,7 @@ cosmic-panel-config = {git = "https://github.com/pop-os/cosmic-panel", features cascade = "1.0.0" gtk4 = { git = "https://github.com/gtk-rs/gtk4-rs", features = ["v4_4"] } adw = { git = "https://gitlab.gnome.org/World/Rust/libadwaita-rs", package = "libadwaita"} +libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false } once_cell = "1.9.0" pretty_env_logger = "0.4" anyhow = "1.0.50" diff --git a/applets/cosmic-panel-button/src/apps_window/mod.rs b/applets/cosmic-panel-button/src/apps_window/mod.rs index 264da380..e63fd0b8 100644 --- a/applets/cosmic-panel-button/src/apps_window/mod.rs +++ b/applets/cosmic-panel-button/src/apps_window/mod.rs @@ -41,14 +41,17 @@ impl CosmicPanelAppButtonWindow { Button::new(); ..add_css_class("apps"); }; - let pixels = std::env::var("COSMIC_PANEL_SIZE").ok().and_then(|size| match size.parse::() { - Ok(PanelSize::XL) => Some(64), - Ok(PanelSize::L) => Some(48), - Ok(PanelSize::M) => Some(36), - Ok(PanelSize::S) => Some(24), - Ok(PanelSize::XS) => Some(18), - Err(_) => Some(36), - }).unwrap_or(36); + let pixels = std::env::var("COSMIC_PANEL_SIZE") + .ok() + .and_then(|size| match size.parse::() { + Ok(PanelSize::XL) => Some(64), + Ok(PanelSize::L) => Some(48), + Ok(PanelSize::M) => Some(36), + Ok(PanelSize::S) => Some(24), + Ok(PanelSize::XS) => Some(18), + Err(_) => Some(36), + }) + .unwrap_or(36); let icon = apps_desktop_info.icon().unwrap_or_else(|| { Icon::for_string("image-missing").expect("Failed to set default icon") }); diff --git a/applets/cosmic-panel-button/src/main.rs b/applets/cosmic-panel-button/src/main.rs index a678b401..be822624 100644 --- a/applets/cosmic-panel-button/src/main.rs +++ b/applets/cosmic-panel-button/src/main.rs @@ -37,9 +37,8 @@ fn load_css() { } fn main() { - let _ = gtk4::init(); - adw::init(); - + let _ = libcosmic::init(); + // Initialize logger pretty_env_logger::init(); glib::set_application_name("Cosmic Panel App Button"); diff --git a/debian/control b/debian/control index e1ed793e..c232a9c8 100644 --- a/debian/control +++ b/debian/control @@ -12,6 +12,7 @@ Build-Depends: libpulse-dev, just, pkg-config, + desktop-file-utils, Standards-Version: 4.3.0 Homepage: https://github.com/pop-os/cosmic-applets @@ -20,4 +21,4 @@ Architecture: amd64 arm64 Depends: ${misc:Depends}, ${shlibs:Depends} -Description: XDG Shell Wrapper +Description: Cosmic Applets diff --git a/libcosmic-applet/src/button.rs b/libcosmic-applet/src/button.rs index 12a1aeb3..ec63a192 100644 --- a/libcosmic-applet/src/button.rs +++ b/libcosmic-applet/src/button.rs @@ -100,17 +100,18 @@ impl AppletButton { pub fn set_button_icon_name(&self, name: &str) { let image = gtk4::Image::from_icon_name(name); - let pixels = std::env::var("COSMIC_PANEL_SIZE").ok().and_then(|size| match size.parse::() { - Ok(PanelSize::XL) => Some(64), - Ok(PanelSize::L) => Some(48), - Ok(PanelSize::M) => Some(36), - Ok(PanelSize::S) => Some(24), - Ok(PanelSize::XS) => Some(18), - Err(_) => Some(36), - }).unwrap_or(36); - image.set_pixel_size( - pixels - ); + let pixels = std::env::var("COSMIC_PANEL_SIZE") + .ok() + .and_then(|size| match size.parse::() { + Ok(PanelSize::XL) => Some(64), + Ok(PanelSize::L) => Some(48), + Ok(PanelSize::M) => Some(36), + Ok(PanelSize::S) => Some(24), + Ok(PanelSize::XS) => Some(18), + Err(_) => Some(36), + }) + .unwrap_or(36); + image.set_pixel_size(pixels); self.set_button_child(Some(&image)); }