appDisplay: Fix cut-off folders in All view
We already take care of growing the view if open folders overlap at the bottom, however folder popups may still end up being cut off when opening above the source icon - if the popup is high enough, its y coordinate will be negative and therefore outside the parent's allocation. To fix, we can either make sure that folders pop up below their source icon in that case, or adjust the parent grid's position as necessary while a folder is open. This implements the latter. https://bugzilla.gnome.org/show_bug.cgi?id=694371
This commit is contained in:
parent
b799e8c0a6
commit
d8d0afff0b
@ -279,8 +279,12 @@ const AllView = new Lang.Class({
|
|||||||
this._eventBlocker.reactive = isOpen;
|
this._eventBlocker.reactive = isOpen;
|
||||||
this._currentPopup = isOpen ? popup : null;
|
this._currentPopup = isOpen ? popup : null;
|
||||||
this._updateIconOpacities(isOpen);
|
this._updateIconOpacities(isOpen);
|
||||||
if (isOpen)
|
if (isOpen) {
|
||||||
this._ensureIconVisible(popup.actor);
|
this._ensureIconVisible(popup.actor);
|
||||||
|
this._grid.actor.y = popup.parentOffset;
|
||||||
|
} else {
|
||||||
|
this._grid.actor.y = 0;
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -594,7 +598,9 @@ const FolderIcon = new Lang.Class({
|
|||||||
// Position the popup above or below the source icon
|
// Position the popup above or below the source icon
|
||||||
if (side == St.Side.BOTTOM) {
|
if (side == St.Side.BOTTOM) {
|
||||||
this._popup.actor.show();
|
this._popup.actor.show();
|
||||||
this._popup.actor.y = this.actor.y - this._popup.actor.height;
|
let y = this.actor.y - this._popup.actor.height;
|
||||||
|
this._popup.parentOffset = y < 0 ? -y : 0;
|
||||||
|
this._popup.actor.y = Math.max(y, 0);
|
||||||
this._popup.actor.hide();
|
this._popup.actor.hide();
|
||||||
} else {
|
} else {
|
||||||
this._popup.actor.y = this.actor.y + this.actor.height;
|
this._popup.actor.y = this.actor.y + this.actor.height;
|
||||||
@ -617,6 +623,7 @@ const AppFolderPopup = new Lang.Class({
|
|||||||
this._arrowSide = side;
|
this._arrowSide = side;
|
||||||
|
|
||||||
this._isOpen = false;
|
this._isOpen = false;
|
||||||
|
this.parentOffset = 0;
|
||||||
|
|
||||||
this.actor = new St.Widget({ layout_manager: new Clutter.BinLayout(),
|
this.actor = new St.Widget({ layout_manager: new Clutter.BinLayout(),
|
||||||
visible: false,
|
visible: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user