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.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/148>
This commit is contained in:
Florian Müllner
2020-04-15 23:32:20 +02:00
parent f0ff0e1400
commit 5df0fa145b

View File

@@ -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);