diff --git a/prefs.js b/prefs.js index ec05e87..06133d5 100644 --- a/prefs.js +++ b/prefs.js @@ -75,6 +75,36 @@ var PreferencesDialog = class PreferencesDialog { // Initialize the fire-preset dropdown. this._createFirePresets(); + // Add a menu to the title bar of the preferences dialog. + this._widget.connect('realize', (widget) => { + const window = widget.get_root(); + + // Show the version number in the title bar. + window.set_title(`Burn-My-Windows ${Me.metadata.version}`); + + // Add the menu. + const menu = this._builder.get_object('menu-button'); + window.get_titlebar().pack_end(menu); + + // Populate the actions. + const group = Gio.SimpleActionGroup.new(); + + const addAction = (name, uri) => { + const action = Gio.SimpleAction.new(name, null); + action.connect('activate', () => Gtk.show_uri(null, uri, Gdk.CURRENT_TIME)); + group.add_action(action); + }; + + addAction('homepage', 'https://github.com/Schneegans/Burn-My-Windows'); + addAction('bugs', 'https://github.com/Schneegans/Burn-My-Windows/issues'); + addAction( + 'donate-paypal', + 'https://www.paypal.com/donate/?hosted_button_id=3F7UFL8KLVPXE'); + addAction('donate-github', 'https://github.com/sponsors/Schneegans'); + + window.insert_action_group('prefs', group); + }); + // As we do not have something like a destructor, we just listen for the destroy // signal of our main widget. this._widget.connect('destroy', () => { diff --git a/resources/ui/gtk3.ui b/resources/ui/gtk3.ui index 44a8eb1..91669b3 100644 --- a/resources/ui/gtk3.ui +++ b/resources/ui/gtk3.ui @@ -19,6 +19,37 @@ +
+ + + + + + +