From 5f692f4651c3607ea045c7872ecc4077e316d4cc Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Mon, 23 May 2022 20:32:33 -0400 Subject: [PATCH] added about dialog --- src/popover.rs | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/popover.rs b/src/popover.rs index d0943dd..245b47f 100644 --- a/src/popover.rs +++ b/src/popover.rs @@ -3,6 +3,7 @@ use futures::executor::block_on; use gtk4::prelude::*; use gtk4::subclass::prelude::*; use gtk4::{ + AboutDialog, gdk::Paintable, glib::*, ApplicationWindow, @@ -11,6 +12,7 @@ use gtk4::{ Window, Popover, Builder, + License, IconTheme, IconLookupFlags, TextDirection, @@ -45,5 +47,27 @@ impl CustomPopoverMenu { self.pop_box.append(&self.subtest_text_view); self.pop_box.set_visible(true); self.popover.set_child(Some(&self.pop_box)); - } + } + + pub fn click_about_button(&self, + //window: Rc + ) { + self.test_text_view.connect_clicked(clone!(@strong self as this => + move |_| { + let about_dialog = AboutDialog::builder() + .program_name("SNESPatcher") + .version("0.1.0") + .comments("GTK4 app to patch your SNES ROMs!") + .authors(["Wyatt J. Miller".to_string()].to_vec()) + .documenters(["Wyatt J. Miller".to_string()].to_vec()) + .license_type(License::Mpl20) + .website("https://scm.wyattjmiller.com/wymiller/snespatcher") + .website_label("Website?") + .modal(false) + .can_focus(true) + //.child(&window) + .build(); + about_dialog.show(); + })); + } } \ No newline at end of file