panelMenu: Remove usage of this.actor from Button

Remove this.actor = actor, since the class is now an actor itself.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/487
This commit is contained in:
Marco Trevisan (Treviño)
2019-04-09 18:17:51 -05:00
committed by Florian Müllner
parent 1be933bc49
commit fedb8e706a
5 changed files with 42 additions and 44 deletions

View File

@ -14,12 +14,11 @@ class ButtonBox extends St.Widget {
super._init(params);
this.actor = this;
this._delegate = this;
this.container = new St.Bin({ y_fill: true,
x_fill: true,
child: this.actor });
child: this });
this.connect('style-changed', this._onStyleChanged.bind(this));
this.connect('destroy', this._onDestroy.bind(this));
@ -105,9 +104,9 @@ var Button = GObject.registerClass({
this.connect('notify::visible', this._onVisibilityChanged.bind(this));
if (dontCreateMenu)
this.menu = new PopupMenu.PopupDummyMenu(this.actor);
this.menu = new PopupMenu.PopupDummyMenu(this);
else
this.setMenu(new PopupMenu.PopupMenu(this.actor, menuAlignment, St.Side.TOP, 0));
this.setMenu(new PopupMenu.PopupMenu(this, menuAlignment, St.Side.TOP, 0));
}
setSensitive(sensitive) {
@ -145,7 +144,7 @@ var Button = GObject.registerClass({
if (!this.menu)
return;
if (!this.actor.visible)
if (!this.visible)
this.menu.close();
}
@ -155,10 +154,10 @@ var Button = GObject.registerClass({
let symbol = event.get_key_symbol();
if (symbol == Clutter.KEY_Left || symbol == Clutter.KEY_Right) {
let group = global.focus_manager.get_group(this.actor);
let group = global.focus_manager.get_group(this);
if (group) {
let direction = (symbol == Clutter.KEY_Left) ? St.DirectionType.LEFT : St.DirectionType.RIGHT;
group.navigate_focus(this.actor, direction, false);
group.navigate_focus(this, direction, false);
return Clutter.EVENT_STOP;
}
}
@ -167,9 +166,9 @@ var Button = GObject.registerClass({
_onOpenStateChanged(menu, open) {
if (open)
this.actor.add_style_pseudo_class('active');
this.add_style_pseudo_class('active');
else
this.actor.remove_style_pseudo_class('active');
this.remove_style_pseudo_class('active');
// Setting the max-height won't do any good if the minimum height of the
// menu is higher then the screen; it's useful if part of the menu is