[gnome-shell-extensions] places-menu: Adjust to GObject-ification of menu items
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions] places-menu: Adjust to GObject-ification of menu items
- Date: Wed, 29 May 2019 09:42:54 +0000 (UTC)
commit 3a596054ad11035eae9451868b586e0ee728bb70
Author: Florian Müllner <fmuellner gnome org>
Date: Wed May 29 08:47:26 2019 +0000
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 a648c0a..00aa04d 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',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]