[gnome-shell-extensions/wip/fmuellner/gtk4: 12/19] window-list: Port to GTK4




commit eaa53abc9c946fcc45fd3226c2edeabd868ff857
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Apr 15 23:32:20 2020 +0200

    window-list: Port to GTK4
    
    Another easy port:
     - replace Gtk.Container methods
     - stop using show_all()
     - Gtk.CheckButton now provides the
       Gtk.RadioButton functionality as well

 extensions/window-list/prefs.js | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/extensions/window-list/prefs.js b/extensions/window-list/prefs.js
index 58ebf2a..217c222 100644
--- a/extensions/window-list/prefs.js
+++ b/extensions/window-list/prefs.js
@@ -27,7 +27,7 @@ class WindowListPrefsWidget extends Gtk.Box {
         });
 
         let groupingLabel = '<b>%s</b>'.format(_('Window Grouping'));
-        this.add(new Gtk.Label({
+        this.append(new Gtk.Label({
             label: groupingLabel, use_markup: true,
             halign: Gtk.Align.START,
         }));
@@ -37,7 +37,7 @@ class WindowListPrefsWidget extends Gtk.Box {
             spacing: 12,
             margin_bottom: 12,
         });
-        this.add(box);
+        this.append(box);
 
         const context = box.get_style_context();
         const cssProvider = new Gtk.CssProvider();
@@ -70,13 +70,13 @@ class WindowListPrefsWidget extends Gtk.Box {
                 continue;
             }
 
-            radio = new Gtk.RadioButton({
+            radio = new Gtk.CheckButton({
                 active: !i,
                 label,
                 group: radio,
                 margin_end: 12,
             });
-            box.add(radio);
+            box.append(radio);
 
             if (currentMode === mode)
                 currentRadio = radio;
@@ -94,15 +94,13 @@ class WindowListPrefsWidget extends Gtk.Box {
             label: _('Show on all monitors'),
         });
         this._settings.bind('show-on-all-monitors', check, 'active', Gio.SettingsBindFlags.DEFAULT);
-        this.add(check);
+        this.append(check);
 
         check = new Gtk.CheckButton({
             label: _('Show windows from all workspaces'),
         });
         this._settings.bind('display-all-workspaces', check, 'active', Gio.SettingsBindFlags.DEFAULT);
-        this.add(check);
-
-        this.show_all();
+        this.append(check);
     }
 });
 


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