mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Remove close button from previews having transient
This commit is contained in:
8
utils.js
8
utils.js
@@ -283,6 +283,14 @@ var getWorkspaceCount = function() {
|
||||
return DisplayWrapper.getWorkspaceManager().n_workspaces;
|
||||
};
|
||||
|
||||
var checkIfWindowHasTransient = function(window) {
|
||||
let hasTransient;
|
||||
|
||||
window.foreach_transient(t => !(hasTransient = true));
|
||||
|
||||
return hasTransient;
|
||||
};
|
||||
|
||||
var findIndex = function(array, predicate) {
|
||||
if (Array.prototype.findIndex) {
|
||||
return array.findIndex(predicate);
|
||||
|
||||
@@ -597,6 +597,7 @@ var Preview = Utils.defineClass({
|
||||
});
|
||||
|
||||
this.window = null;
|
||||
this._needsCloseButton = true;
|
||||
this.cloneWidth = this.cloneHeight = 0;
|
||||
this._panelWrapper = panelWrapper;
|
||||
this._previewMenu = previewMenu;
|
||||
@@ -702,6 +703,7 @@ var Preview = Utils.defineClass({
|
||||
|
||||
this._removeWindowSignals();
|
||||
this.window = window;
|
||||
this._needsCloseButton = window.can_close() && !Utils.checkIfWindowHasTransient(window);
|
||||
this._updateHeader();
|
||||
},
|
||||
|
||||
@@ -853,7 +855,9 @@ var Preview = Utils.defineClass({
|
||||
},
|
||||
|
||||
_hideOrShowCloseButton: function(hide) {
|
||||
Tweener.addTween(this._closeButtonBin, getTweenOpts({ opacity: hide ? 0 : 255 }));
|
||||
if (this._needsCloseButton) {
|
||||
Tweener.addTween(this._closeButtonBin, getTweenOpts({ opacity: hide ? 0 : 255 }));
|
||||
}
|
||||
},
|
||||
|
||||
_getBackgroundColor: function(offset, alpha) {
|
||||
|
||||
Reference in New Issue
Block a user