Skip to content

Commit

Permalink
gtk4: Switch to AdwAboutWindow
Browse files Browse the repository at this point in the history
Signed-off-by: Fiana Fortressia <fortressnordlys@outlook.com>
  • Loading branch information
togetherwithasteria authored and A6GibKm committed Apr 1, 2023
1 parent b01b8bb commit 028cea8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 69 deletions.
5 changes: 2 additions & 3 deletions src/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
const {GObject, Gtk, Gdk, Gio, Adw} = imports.gi;

const {FlatsealWindow} = imports.widgets.window;
const {FlatsealAboutDialog} = imports.widgets.aboutDialog;
const {showAboutDialog} = imports.widgets.aboutDialog;
const {FlatsealDocsViewer} = imports.widgets.docsViewer;
const {FlatsealShortcutsWindow} = imports.widgets.shortcutsWindow;

Expand All @@ -48,8 +48,7 @@ var FlatsealApplication = GObject.registerClass({
}

_displayAbout() {
const dialog = new FlatsealAboutDialog({transient_for: this._window, modal: true});
dialog.present();
showAboutDialog(this._window);
}

_displayShortcuts() {
Expand Down
26 changes: 7 additions & 19 deletions src/widgets/aboutDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,11 @@
*/

const {GObject, Gtk} = imports.gi;
const ABOUT_RESOURCE = "/com/github/tchx84/Flatseal/widgets/aboutDialog.ui";
function showAboutDialog(window) {
const builder = Gtk.Builder.new_from_resource(ABOUT_RESOURCE);


var FlatsealAboutDialog = GObject.registerClass({
GTypeName: 'FlatsealAboutDialog',
Properties: {
contributors: GObject.ParamSpec.string(
'contributors',
'contributors',
'contributors',
GObject.ParamFlags.READWRITE, ''),
},
Template: 'resource:///com/github/tchx84/Flatseal/widgets/aboutDialog.ui',
}, class FlatsealAboutDialog extends Gtk.AboutDialog {
_init(props) {
super._init(props);
const contributors = this.contributors.split('\n');
this.add_credit_section(_('Contributions by'), contributors);

}
});
const dialog = builder.get_object("about-window");
dialog.transient_for = window;
dialog.present();
}
68 changes: 21 additions & 47 deletions src/widgets/aboutDialog.ui
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0" />
<template class="FlatsealAboutDialog" parent="GtkAboutDialog">
<property name="type_hint">dialog</property>
<property name="program_name">Flatseal</property>
<object class="AdwAboutWindow" id="about-window">
<property name="application_name">Flatseal</property>
<property name="modal">True</property>
<property name="version">1.8.1</property>
<property name="copyright">© 2020-2022 Martin Abente Lahaye</property>
<property name="comments" translatable="yes">Flatseal is a graphical utility to review and modify permissions from your Flatpak applications.</property>
<property name="website">https://github.com/tchx84/flatseal</property>
<property name="website_label">Flatseal</property>
<property name="authors">Martin Abente Lahaye</property>
<property name="issue_url">https://github.com/tchx84/Flatseal/issues/new</property>
<property name="developer_name">Martin Abente Lahaye</property>
<property name="developers">Martin Abente Lahaye
Bilal Elmoussaoui
Adrien Plazas
Kevin Degeling
Mufeed Ali
Leorize
Christopher Davis
Lctrs
Will Thompson
Jonas Johan Solsvik
Maximiliano Sandoval
Ferenc
rusty-snake
Guilhem Morer</property>
<property name="translator_credits">Daniel Rusek
Heimen Stoffels
Tim Rieck
Expand All @@ -33,45 +45,7 @@ Philipp Kiemle</property>
<property name="artists">Tobias Bernard
J.P. MacDonald</property>
<property name="documenters">TheEvilSkeleton</property>
<property name="contributors">Bilal Elmoussaoui
Adrien Plazas
Kevin Degeling
Mufeed Ali
Leorize
Christopher Davis
Lctrs
Will Thompson
Jonas Johan Solsvik
Maximiliano Sandoval
Ferenc
rusty-snake
Guilhem Morer</property>
<property name="logo_icon_name">com.github.tchx84.Flatseal</property>
<property name="application_icon">com.github.tchx84.Flatseal</property>
<property name="license_type">gpl-3-0</property>
<child>
<placeholder />
</child>
<child internal-child="vbox">
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox">
<property name="valign">center</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<placeholder />
</child>
<child>
<placeholder />
</child>
</object>
</child>
<child>
<placeholder />
</child>
</object>
</child>
</template>
</object>
</interface>

0 comments on commit 028cea8

Please sign in to comment.