cleanup: Replace signal connections with virtual functions
Inheriting from actors allows to use virtual functions instead of signal connections for multiple cases, so just use them when possible. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/559
This commit is contained in:

committed by
Florian Müllner

parent
320df13b65
commit
55b57421dc
@ -81,11 +81,6 @@ var AuthPrompt = GObject.registerClass({
|
||||
});
|
||||
|
||||
this.connect('destroy', this._onDestroy.bind(this));
|
||||
this.connect('key-press-event', (actor, event) => {
|
||||
if (event.get_key_symbol() == Clutter.KEY_Escape)
|
||||
this.cancel();
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
});
|
||||
|
||||
this._userWell = new St.Bin({ x_fill: true, x_align: St.Align.START });
|
||||
this.add(this._userWell, {
|
||||
@ -145,6 +140,12 @@ var AuthPrompt = GObject.registerClass({
|
||||
this._userVerifier = null;
|
||||
}
|
||||
|
||||
vfunc_key_press_event(keyPressEvent) {
|
||||
if (keyPressEvent.keyval == Clutter.KEY_Escape)
|
||||
this.cancel();
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
}
|
||||
|
||||
_initButtons() {
|
||||
this.cancelButton = new St.Button({ style_class: 'modal-dialog-button button',
|
||||
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
|
||||
|
Reference in New Issue
Block a user