dash: Consider additions for separator visibility

The children variable holds the icons that were originally in
the dash. For the separator visibility, we should consider the
icons that are in the dash after the update, so we must consider
additions as well as removals.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1659>
This commit is contained in:
Florian Müllner 2021-02-09 21:48:39 +01:00 committed by Marge Bot
parent 6a2ed852e7
commit 9aa25eaa0b

View File

@ -745,7 +745,7 @@ var Dash = GObject.registerClass({
// Update separator // Update separator
const nFavorites = Object.keys(favorites).length; const nFavorites = Object.keys(favorites).length;
const nIcons = children.length - removedActors.length; const nIcons = children.length + addedItems.length - removedActors.length;
if (nFavorites > 0 && nFavorites < nIcons) { if (nFavorites > 0 && nFavorites < nIcons) {
if (!this._separator) { if (!this._separator) {
this._separator = new St.Widget({ this._separator = new St.Widget({