diff --git a/src/application.js b/src/application.js index 2b5ee104..7eb864ed 100644 --- a/src/application.js +++ b/src/application.js @@ -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; @@ -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() { diff --git a/src/widgets/aboutDialog.js b/src/widgets/aboutDialog.js index 3aa9bf58..625fcd66 100644 --- a/src/widgets/aboutDialog.js +++ b/src/widgets/aboutDialog.js @@ -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(); +} diff --git a/src/widgets/aboutDialog.ui b/src/widgets/aboutDialog.ui index fc2f1e06..1d6c0b20 100644 --- a/src/widgets/aboutDialog.ui +++ b/src/widgets/aboutDialog.ui @@ -1,15 +1,27 @@ - +