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:
Marco Trevisan (Treviño)
2019-09-10 07:42:48 +02:00
committed by Florian Müllner
parent 320df13b65
commit 55b57421dc
30 changed files with 434 additions and 414 deletions

View File

@ -47,7 +47,7 @@ var StreamSlider = class {
return this._slider.startDragging(event);
});
this.item.connect('key-press-event', (actor, event) => {
return this._slider.onKeyPressEvent(actor, event);
return this._slider.emit('key-press-event', event);
});
this._stream = null;
@ -375,12 +375,10 @@ var Indicator = GObject.registerClass({
});
this.menu.addMenuItem(this._volumeMenu);
this.connect('scroll-event', this._onScrollEvent.bind(this));
}
_onScrollEvent(actor, event) {
let result = this._volumeMenu.scroll(event);
vfunc_scroll_event() {
let result = this._volumeMenu.scroll(Clutter.get_current_event());
if (result == Clutter.EVENT_PROPAGATE || this.menu.actor.mapped)
return result;