mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
implement about dialog
This commit is contained in:
parent
39ee50c4ba
commit
eca93df1eb
7 changed files with 74 additions and 11 deletions
41
src/app/browser/about.rs
Normal file
41
src/app/browser/about.rs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
use adw::{prelude::AdwDialogExt, AboutDialog};
|
||||
use gtk::{prelude::IsA, License};
|
||||
|
||||
pub struct About {
|
||||
gobject: AboutDialog,
|
||||
}
|
||||
|
||||
impl About {
|
||||
// Construct
|
||||
pub fn new() -> Self {
|
||||
// Collect debug info
|
||||
let debug = &[
|
||||
format!(
|
||||
"GTK {}.{}.{}",
|
||||
gtk::major_version(),
|
||||
gtk::minor_version(),
|
||||
gtk::micro_version()
|
||||
),
|
||||
format!("SQLite {}", sqlite::version()),
|
||||
// @TODO
|
||||
];
|
||||
|
||||
// Init gobject
|
||||
let gobject = AboutDialog::builder()
|
||||
.application_name(env!("CARGO_PKG_NAME"))
|
||||
.debug_info(debug.join("\n"))
|
||||
.developer_name(env!("CARGO_PKG_DESCRIPTION"))
|
||||
.issue_url(env!("CARGO_PKG_REPOSITORY"))
|
||||
.license_type(License::MitX11)
|
||||
.version(env!("CARGO_PKG_VERSION"))
|
||||
.build();
|
||||
|
||||
// Return new struct
|
||||
Self { gobject }
|
||||
}
|
||||
|
||||
// Actions
|
||||
pub fn present(&self, parent: Option<&impl IsA<gtk::Widget>>) {
|
||||
self.gobject.present(parent);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue