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

@@ -288,7 +288,9 @@ namespace VocaluxeLib.Menu.SongMenu
public void LeaveSelectedCategory()
{
_LeaveCategory();
// Stefan1200: This was implemented with the pull request #359 and is the reason for the bug described in issue #390.
// Currently disabled until we know if this is still needed or we find a better solution!
// _LeaveCategory();
}
public virtual void UnloadSkin() {}
@@ -425,4 +427,4 @@ namespace VocaluxeLib.Menu.SongMenu
}
#endregion ThemeEdit
}
}
}
+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);
}