Merge branch 'develop' into PreviewDisableFix

This commit is contained in:
Stefan authored and GitHub committed 2020-01-15 22:36:12 +01:00
commit 95962e98fd
27 files changed
+710 -120

No files matched your search

+17 -2
View File
@@ -594,13 +594,28 @@ namespace VocaluxeLib.Menu.SongMenu
private void _UpdateList(bool force = false)
{
bool isInCategory = CBase.Songs.IsInCategory();
int itemCount = isInCategory ? CBase.Songs.GetNumSongsVisible() : CBase.Songs.GetNumCategories();
int halfListLength = _ListLength / 2;
int offset;
if (_SelectionNr < _Offset && _SelectionNr >= 0)
offset = _SelectionNr;
{
if (_SelectionNr - halfListLength >= 0)
offset = _SelectionNr - halfListLength;
else
offset = 0;
}
else if (_SelectionNr >= _Offset + _ListLength)
offset = _SelectionNr - _ListLength + 1;
{
if (_SelectionNr + halfListLength > itemCount)
offset = itemCount - _ListLength;
else
offset = _SelectionNr - halfListLength;
}
else
offset = _Offset;
_UpdateList(offset, force);
}