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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user