dash: Allow adding favorites out of favorites zone

Previously, you could not add favorites outside of the favorites zone.
This change inserts a placeholder at the end of the favorites zone if
you are outside of it.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2777
This commit is contained in:
Bryan Dunsmore 2020-05-13 11:28:53 -05:00 committed by Florian Müllner
parent fba350eaad
commit 0737c8f416

View File

@ -815,7 +815,12 @@ var Dash = GObject.registerClass({
else else
pos = 0; // always insert at the top when dash is empty pos = 0; // always insert at the top when dash is empty
if (pos != this._dragPlaceholderPos && pos <= numFavorites && this._animatingPlaceholdersCount == 0) { // Put the placeholder after the last favorite if we are not
// in the favorites zone
if (pos > numFavorites)
pos = numFavorites;
if (pos !== this._dragPlaceholderPos && this._animatingPlaceholdersCount === 0) {
this._dragPlaceholderPos = pos; this._dragPlaceholderPos = pos;
// Don't allow positioning before or after self // Don't allow positioning before or after self
@ -843,11 +848,6 @@ var Dash = GObject.registerClass({
this._dragPlaceholder.show(fadeIn); this._dragPlaceholder.show(fadeIn);
} }
// Remove the drag placeholder if we are not in the
// "favorites zone"
if (pos > numFavorites)
this._clearDragPlaceholder();
if (!this._dragPlaceholder) if (!this._dragPlaceholder)
return DND.DragMotionResult.NO_DROP; return DND.DragMotionResult.NO_DROP;