refactor: replace gtk4 about dialog with libadwaita's one

This commit is contained in:
MeexReay 2025-08-31 16:29:15 +03:00
parent 46778bc646
commit 88f02f2e11
2 changed files with 12 additions and 12 deletions

View File

@ -10,7 +10,7 @@ lazy_static = "1.5.0"
serde_yml = "0.0.12"
homedir = "0.3.4"
native-tls = "0.2.14"
clap = { version = "4.5.36", features = ["derive"] }
clap = { version = "4.5.36", features = ["derive", "cargo"] }
serde = { version = "1.0.219", features = ["serde_derive"] }
# gtk4 = { version = "0.9.6", optional = true }
chrono = "0.4.40"
@ -22,7 +22,7 @@ gdk-pixbuf = { version = "0.3.0", optional = true } # DO NOT UPDATE
winapi = { version = "0.3.9", optional = true, features = ["wincon", "winuser"] }
tungstenite = "0.27.0"
reqwest = { version = "0.12.20", features = ["blocking"] }
libadwaita = { version = "0.8.0", optional = true }
libadwaita = { version = "0.8.0", optional = true, features = ["v1_5"] }
[build-dependencies]
winresource = { version = "0.1.20", optional = true }

View File

@ -11,6 +11,7 @@ use std::thread;
use std::time::{Duration, SystemTime};
use chrono::Local;
use clap::crate_version;
use libadwaita as adw;
use adw::gdk::{Cursor, Display, Texture};
@ -400,6 +401,7 @@ fn open_settings(ctx: Arc<Context>, app: &Application) {
.resizable(true)
.decorated(true)
.content(&vbox)
.modal(true)
.build();
let controller = gtk::EventControllerKey::new();
@ -456,18 +458,16 @@ fn build_menu(ctx: Arc<Context>, app: &Application) {
#[weak]
app,
move |_, _, _| {
AboutDialog::builder()
.application(&app)
.authors(["MeexReay"])
.license(include_str!("../../LICENSE"))
let dialog = adw::AboutDialog::builder()
.developer_name("MeexReay")
.license(glib::markup_escape_text(include_str!("../../LICENSE")))
.comments("better RAC client")
.website("https://github.com/MeexReay/bRAC")
.website_label("source code")
.logo(&Texture::for_pixbuf(
&load_pixbuf(include_bytes!("images/icon.png")).unwrap(),
))
.build()
.present();
.application_name("bRAC")
.application_icon("ru.themixray.bRAC")
.version(crate_version!())
.build();
dialog.present(app.active_window().as_ref());
}
))
.build(),