cleanup: Stop using PopupMenuItem.actor properties

Popup menu items are now actor subclasses, and their actor property
points to the item itself.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/84
This commit is contained in:
Florian Müllner
2019-07-19 20:24:44 +02:00
parent 60c75e5fcf
commit f8bae05036
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -152,7 +152,7 @@ class DriveMenu extends PanelMenu.Button {
}
_updateMenuVisibility() {
if (this._mounts.filter(i => i.actor.visible).length > 0)
if (this._mounts.filter(i => i.visible).length > 0)
this.show();
else
this.hide();
+5 -5
View File
@@ -435,12 +435,12 @@ class AppContextMenu extends PopupMenu.PopupMenu {
open(animate) {
let windows = this._appButton.getWindowList();
this._minimizeItem.actor.visible = windows.some(w => !w.minimized);
this._unminimizeItem.actor.visible = windows.some(w => w.minimized);
this._maximizeItem.actor.visible = windows.some(w => {
this._minimizeItem.visible = windows.some(w => !w.minimized);
this._unminimizeItem.visible = windows.some(w => w.minimized);
this._maximizeItem.visible = windows.some(w => {
return w.get_maximized() != Meta.MaximizeFlags.BOTH;
});
this._unmaximizeItem.actor.visible = windows.some(w => {
this._unmaximizeItem.visible = windows.some(w => {
return w.get_maximized() == Meta.MaximizeFlags.BOTH;
});
@@ -605,7 +605,7 @@ class AppButton extends BaseButton {
for (let i = 0; i < windows.length; i++) {
let windowTitle = new WindowTitle(windows[i]);
let item = new PopupMenu.PopupBaseMenuItem();
item.actor.add_actor(windowTitle.actor);
item.add_actor(windowTitle.actor);
item._window = windows[i];
this._menu.addMenuItem(item);
}