From 3a596054ad11035eae9451868b586e0ee728bb70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 29 May 2019 08:47:26 +0000 Subject: [PATCH] places-menu: Adjust to GObject-ification of menu items https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/67 --- extensions/places-menu/extension.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js index a648c0a4..00aa04d9 100644 --- a/extensions/places-menu/extension.js +++ b/extensions/places-menu/extension.js @@ -17,19 +17,20 @@ const PlaceDisplay = Me.imports.placeDisplay; const PLACE_ICON_SIZE = 16; +var PlaceMenuItem = GObject.registerClass( class PlaceMenuItem extends PopupMenu.PopupBaseMenuItem { - constructor(info) { - super(); + _init(info) { + super._init(); this._info = info; this._icon = new St.Icon({ gicon: info.icon, icon_size: PLACE_ICON_SIZE }); - this.actor.add_child(this._icon); + this.add_child(this._icon); this._label = new St.Label({ text: info.name, x_expand: true }); - this.actor.add_child(this._label); + this.add_child(this._label); if (info.isRemovable()) { this._ejectIcon = new St.Icon({ @@ -38,7 +39,7 @@ class PlaceMenuItem extends PopupMenu.PopupBaseMenuItem { }); this._ejectButton = new St.Button({ child: this._ejectIcon }); this._ejectButton.connect('clicked', info.eject.bind(info)); - this.actor.add_child(this._ejectButton); + this.add_child(this._ejectButton); } this._changedId = info.connect('changed', @@ -64,7 +65,7 @@ class PlaceMenuItem extends PopupMenu.PopupBaseMenuItem { this._icon.gicon = info.icon; this._label.text = info.name; } -} +}); const SECTIONS = [ 'special',