diff --git a/Cargo.lock b/Cargo.lock index 41a02d7b..5d6416f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1156,7 +1156,6 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", - "serde", ] [[package]] @@ -1167,6 +1166,7 @@ checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", "hashbrown 0.14.2", + "serde", ] [[package]] @@ -1257,6 +1257,7 @@ dependencies = [ "gtk4", "lact-client", "lact-daemon", + "libadwaita", "pretty_assertions", "tracing", "tracing-subscriber", @@ -1268,7 +1269,7 @@ version = "0.5.1" dependencies = [ "amdgpu-sysfs", "clap", - "indexmap 1.9.3", + "indexmap 2.1.0", "serde", "serde_json", ] @@ -1279,6 +1280,38 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "libadwaita" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fe7e70c06507ed10a16cda707f358fbe60fe0dc237498f78c686ade92fd979c" +dependencies = [ + "gdk-pixbuf", + "gdk4", + "gio", + "glib", + "gtk4", + "libadwaita-sys", + "libc", + "pango", +] + +[[package]] +name = "libadwaita-sys" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e10aaa38de1d53374f90deeb4535209adc40cc5dba37f9704724169bceec69a" +dependencies = [ + "gdk4-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk4-sys", + "libc", + "pango-sys", + "system-deps", +] + [[package]] name = "libc" version = "0.2.150" diff --git a/lact-gui/Cargo.toml b/lact-gui/Cargo.toml index 66d2b180..c6bf51ca 100644 --- a/lact-gui/Cargo.toml +++ b/lact-gui/Cargo.toml @@ -7,7 +7,6 @@ edition = "2021" [features] default = ["gtk-tests"] gtk-tests = [] -adw = [] [dependencies] lact-client = { path = "../lact-client" } @@ -16,6 +15,9 @@ gtk = { version = "0.7", package = "gtk4", features = ["v4_6", "blueprint"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } anyhow = "1.0" +adw = { package = "libadwaita", version = "0.5.3", features = [ + "v1_4", +], optional = true } [dev-dependencies] pretty_assertions = "1.4.0" diff --git a/lact-gui/src/app/mod.rs b/lact-gui/src/app/mod.rs index 1cf4a339..33d60468 100644 --- a/lact-gui/src/app/mod.rs +++ b/lact-gui/src/app/mod.rs @@ -37,6 +37,10 @@ pub struct App { impl App { pub fn new(daemon_client: DaemonClient) -> Self { + #[cfg(feature = "adw")] + let application: Application = + adw::Application::new(Some(APP_ID), ApplicationFlags::default()).upcast(); + #[cfg(not(feature = "adw"))] let application = Application::new(Some(APP_ID), ApplicationFlags::default()); let header = Header::new();