[panel] Hide application menu in overview
The activities overview is not a place where we expect users to interact with a specific application, so showing the application menu there is misleading. https://bugzilla.gnome.org/show_bug.cgi?id=618479
This commit is contained in:
parent
a433a1c637
commit
a0be7fa455
@ -681,11 +681,14 @@ AppMenuButton.prototype = {
|
|||||||
this.menu.addMenuItem(this._quitMenu);
|
this.menu.addMenuItem(this._quitMenu);
|
||||||
this._quitMenu.connect('activate', Lang.bind(this, this._onQuit));
|
this._quitMenu.connect('activate', Lang.bind(this, this._onQuit));
|
||||||
|
|
||||||
|
this._visible = !Main.overview.visible;
|
||||||
|
if (!this._visible)
|
||||||
|
this.hide();
|
||||||
Main.overview.connect('hiding', Lang.bind(this, function () {
|
Main.overview.connect('hiding', Lang.bind(this, function () {
|
||||||
this.actor.opacity = 255;
|
this.show();
|
||||||
}));
|
}));
|
||||||
Main.overview.connect('showing', Lang.bind(this, function () {
|
Main.overview.connect('showing', Lang.bind(this, function () {
|
||||||
this.actor.opacity = 192;
|
this.hide();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
let tracker = Shell.WindowTracker.get_default();
|
let tracker = Shell.WindowTracker.get_default();
|
||||||
@ -699,6 +702,36 @@ AppMenuButton.prototype = {
|
|||||||
this._sync();
|
this._sync();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
show: function() {
|
||||||
|
if (this._visible)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.actor.show();
|
||||||
|
Tweener.addTween(this.actor,
|
||||||
|
{ opacity: 255,
|
||||||
|
time: Overview.ANIMATION_TIME,
|
||||||
|
transition: 'easeOutQuad',
|
||||||
|
onComplete: function() {
|
||||||
|
this._visible = true;
|
||||||
|
},
|
||||||
|
onCompleteScope: this });
|
||||||
|
},
|
||||||
|
|
||||||
|
hide: function() {
|
||||||
|
if (!this._visible)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Tweener.addTween(this.actor,
|
||||||
|
{ opacity: 0,
|
||||||
|
time: Overview.ANIMATION_TIME,
|
||||||
|
transition: 'easeOutQuad',
|
||||||
|
onComplete: function() {
|
||||||
|
this.actor.hide();
|
||||||
|
this._visible = false;
|
||||||
|
},
|
||||||
|
onCompleteScope: this });
|
||||||
|
},
|
||||||
|
|
||||||
_getContentPreferredWidth: function(actor, forHeight, alloc) {
|
_getContentPreferredWidth: function(actor, forHeight, alloc) {
|
||||||
let [minSize, naturalSize] = this._iconBox.get_preferred_width(forHeight);
|
let [minSize, naturalSize] = this._iconBox.get_preferred_width(forHeight);
|
||||||
alloc.min_size = minSize;
|
alloc.min_size = minSize;
|
||||||
|
Loading…
Reference in New Issue
Block a user