switcherPopup: Swap Math.max and Math.min in _scrollToLeft

Limit the minimum and maximum value to scroll to inside the box to 0 and
the upper limit, for some reason this was done right in _scrollToRight,
but not in _scrollToLeft.

This fixes the behavior of scrolling to the left: Before, scrolling one
item to the left moved the view to the first element of the list (this
can make the selected element invisible in large lists). Instead, scroll
one item to the left, just like scrolling to the right works.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
This commit is contained in:
Jonas Dreßler 2018-04-25 23:56:29 +02:00 committed by Florian Müllner
parent 172d21cf50
commit 548c41d164

View File

@ -480,9 +480,9 @@ var SwitcherList = GObject.registerClass({
let item = this._items[index];
if (item.allocation.x1 < value)
value = Math.min(0, item.allocation.x1);
value = Math.max(0, item.allocation.x1);
else if (item.allocation.x2 > value + pageSize)
value = Math.max(upper, item.allocation.x2 - pageSize);
value = Math.min(upper, item.allocation.x2 - pageSize);
this._scrollableRight = true;
adjustment.ease(value, {