mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Window Previews: enable/disable in windowPreviews.js
This commit is contained in:
@@ -228,10 +228,13 @@ const taskbarAppIcon = new Lang.Class({
|
||||
}
|
||||
]);
|
||||
|
||||
this.windowPreview.enableWindowPreview();
|
||||
},
|
||||
|
||||
disableWindowPreview: function() {
|
||||
this._signalsHandler.removeWithLabel('window-preview');
|
||||
if (this.windowPreview)
|
||||
this.windowPreview.disableWindowPreview();
|
||||
},
|
||||
|
||||
shouldShowTooltip: function() {
|
||||
|
||||
@@ -73,12 +73,6 @@ const thumbnailPreviewMenu = new Lang.Class({
|
||||
|
||||
Main.uiGroup.add_actor(this.actor);
|
||||
|
||||
this._enterSourceId = this._source.actor.connect('enter-event', Lang.bind(this, this._onEnter));
|
||||
this._leaveSourceId = this._source.actor.connect('leave-event', Lang.bind(this, this._onLeave));
|
||||
|
||||
this._enterMenuId = this.actor.connect('enter-event', Lang.bind(this, this._onMenuEnter));
|
||||
this._leaveMenuId = this.actor.connect('leave-event', Lang.bind(this, this._onMenuLeave));
|
||||
|
||||
// Change the initialized side where required.
|
||||
this._arrowSide = side;
|
||||
this._boxPointer._arrowSide = side;
|
||||
@@ -100,6 +94,35 @@ const thumbnailPreviewMenu = new Lang.Class({
|
||||
this._peekModeCurrentWorkspace = null;
|
||||
},
|
||||
|
||||
enableWindowPreview: function() {
|
||||
// Show window previews on mouse hover
|
||||
this._enterSourceId = this._source.actor.connect('enter-event', Lang.bind(this, this._onEnter));
|
||||
this._leaveSourceId = this._source.actor.connect('leave-event', Lang.bind(this, this._onLeave));
|
||||
|
||||
this._enterMenuId = this.actor.connect('enter-event', Lang.bind(this, this._onMenuEnter));
|
||||
this._leaveMenuId = this.actor.connect('leave-event', Lang.bind(this, this._onMenuLeave));
|
||||
},
|
||||
|
||||
disableWindowPreview: function() {
|
||||
if (this._enterSourceId) {
|
||||
this._source.actor.disconnect(this._enterSourceId);
|
||||
this._enterSourceId = 0;
|
||||
}
|
||||
if (this._leaveSourceId) {
|
||||
this._source.actor.disconnect(this._leaveSourceId);
|
||||
this._leaveSourceId = 0;
|
||||
}
|
||||
|
||||
if (this._enterMenuId) {
|
||||
this.actor.disconnect(this._enterMenuId);
|
||||
this._enterMenuId = 0;
|
||||
}
|
||||
if (this._leaveMenuId) {
|
||||
this.actor.disconnect(this._leaveMenuId);
|
||||
this._leaveMenuId = 0;
|
||||
}
|
||||
},
|
||||
|
||||
requestCloseMenu: function() {
|
||||
// The "~0" argument makes the animation display.
|
||||
this.close(~0);
|
||||
|
||||
Reference in New Issue
Block a user