[gnome-shell-extensions/wip/fmuellner/gtk4: 18/19] workspace-indicator: Use Gtk.Button.icon_name property




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

    workspace-indicator: Use Gtk.Button.icon_name property
    
    Image buttons are a very common pattern, so GTK4 added some
    convenience API we can use to construct them.

 extensions/workspace-indicator/prefs.js | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/extensions/workspace-indicator/prefs.js b/extensions/workspace-indicator/prefs.js
index 374c14f..d45d1e8 100644
--- a/extensions/workspace-indicator/prefs.js
+++ b/extensions/workspace-indicator/prefs.js
@@ -146,14 +146,10 @@ class WorkspaceRow extends Gtk.ListBoxRow {
             GObject.BindingFlags.SYNC_CREATE);
         box.append(label);
 
-        const image = new Gtk.Image({
-            icon_name: 'edit-delete-symbolic',
-            pixel_size: 16,
-        });
         const button = new Gtk.Button({
             action_name: 'workspaces.remove',
             action_target: new GLib.Variant('s', name),
-            child: image,
+            icon_name: 'edit-delete-symbolic',
         });
         box.append(button);
 


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