edgeDragAction: Add signal to notify about progress

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1668>
This commit is contained in:
Carlos Garnacho 2021-02-11 14:15:25 +01:00 committed by Marge Bot
parent 8e73143b24
commit a6a4e0a504

View File

@ -9,7 +9,10 @@ var EDGE_THRESHOLD = 20;
var DRAG_DISTANCE = 80;
var EdgeDragAction = GObject.registerClass({
Signals: { 'activated': {} },
Signals: {
'activated': {},
'progress': { param_types: [GObject.TYPE_DOUBLE] },
},
}, class EdgeDragAction extends Clutter.GestureAction {
_init(side, allowedModes) {
super._init();
@ -60,6 +63,12 @@ var EdgeDragAction = GObject.registerClass({
return false;
}
if (this._side === St.Side.TOP ||
this._side === St.Side.BOTTOM)
this.emit('progress', offsetY);
else
this.emit('progress', offsetX);
return true;
}