add a Copyright button (#40)

This commit is contained in:
Adam Perkowski
2024-10-24 18:40:34 +02:00
committed by GitHub
parent 5a8b64df50
commit 6e06af1f10

View File

@@ -49,14 +49,36 @@ fn build_ui(app: &Application) {
});
let undo_button = Button::with_label("Undo Changes");
let copy_button = Button::with_label("Copyright");
let gui_clone = gui.clone();
undo_button.connect_clicked(move |_| {
undo_changes(gui_clone.clone());
});
let gui_clone = gui.clone();
copy_button.connect_clicked(move |_| {
gui_clone.borrow_mut().custom_info_popup(
"Copyright (C) 2024 Nyx, Adam Perkowski",
"This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation, version 2 of
the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see
<https://www.gnu.org/licenses/old-licenses/gpl-2.0>.",
true,
);
});
if let Some(gear_menu_box) = gui.borrow().gear_menu.borrow().child() {
if let Some(box_widget) = gear_menu_box.downcast_ref::<gtk::Box>() {
box_widget.append(&undo_button);
box_widget.append(&copy_button);
}
}
}