[gnome-weather/wip/cdavis/about-window] window: Port about to AdwAboutWindow




commit 18a04c09d02b2e2550b26d7dedc941f627241b60
Author: Christopher Davis <christopherdavis gnome org>
Date:   Thu Jul 7 17:52:27 2022 -0400

    window: Port about to AdwAboutWindow

 meson.build       |  2 +-
 src/app/window.js | 34 ++++++++++++++--------------------
 2 files changed, 15 insertions(+), 21 deletions(-)
---
diff --git a/meson.build b/meson.build
index 7766944..b269436 100644
--- a/meson.build
+++ b/meson.build
@@ -12,7 +12,7 @@ dependency('gobject-introspection-1.0', version: '>=1.35.9')
 dependency('gtk4', version :'>=4.5')
 dependency('gjs-1.0', version: '>= 1.71.0')
 dependency('geoclue-2.0', version: '>= 0.12.99')
-dependency('libadwaita-1')
+dependency('libadwaita-1', version: '>=  1.2.alpha')
 dependency('gweather4', version: '>= 3.90.0')
 
 # Profiles
diff --git a/src/app/window.js b/src/app/window.js
index a71cb32..4439f6e 100644
--- a/src/app/window.js
+++ b/src/app/window.js
@@ -147,7 +147,7 @@ export const MainWindow = GObject.registerClass({
     }
 
     _showAbout() {
-        let artists = ['Jakub Steiner <jimmac gmail com>',
+        let designers = ['Jakub Steiner <jimmac gmail com>',
             'Pink Sherbet Photography (D. Sharon Pruitt)',
             'Elliott Brown',
             'Analogick',
@@ -156,35 +156,29 @@ export const MainWindow = GObject.registerClass({
             'Tech Haven Ministries',
             'Jim Pennucci'];
 
-        let name_prefix = '';
-
         let copyright = 'Copyright 2013-2015 The Weather Developers';
         let attribution = this._cityView.info ? this._cityView.info.get_attribution() : '';
-        copyright += attribution ? '\n' + attribution : '';
-        let aboutDialog = new Gtk.AboutDialog(
+
+        let aboutWindow = new Adw.AboutWindow(
             {
-                artists: artists,
-                authors: ['Giovanni Campagna <gcampagna src gnome org>'],
+                developers: ['Giovanni Campagna <gcampagna src gnome org>'],
+                designers: designers,
                 translator_credits: _("translator-credits"),
-                program_name: name_prefix + _("Weather"),
-                comments: _("A weather application"),
+                application_name: _("Weather"),
+                application_icon: pkg.name,
+                developer_name: _("The GNOME Project"),
+                copyright: copyright,
                 license_type: Gtk.License.GPL_2_0,
-                logo_icon_name: pkg.name,
                 version: pkg.version,
                 website: 'https://wiki.gnome.org/Apps/Weather',
-                wrap_license: true,
-                modal: true,
+                issue_url: 'https://gitlab.gnome.org/GNOME/gnome-weather/-/issues/new',
                 transient_for: this
             });
 
-        // HACK: we need to poke into gtkaboutdialog internals
-        // to set the copyright with markup like attribution requires
-        // FIXME: file a gtk+ bug
-
-        let copyrightLabel = aboutDialog.get_template_child(Gtk.AboutDialog, 'copyright_label');
-        copyrightLabel.set_markup('<span size="small">' + copyright + '</span>');
-        copyrightLabel.show();
+        if (attribution.len > 0) {
+            aboutWindow.add_legal_section(_("Weather"), null, Gtk.LicenseCustom, attribution);
+        }
 
-        aboutDialog.show();
+        aboutWindow.show();
     }
 });


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]