mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Merge pull request #18603 from peppy/fix-import-dialog
Add placeholder when no results are visible at song select
This commit is contained in:
@ -98,6 +98,8 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
protected readonly CarouselScrollContainer Scroll;
|
||||
|
||||
private readonly NoResultsPlaceholder noResultsPlaceholder;
|
||||
|
||||
private IEnumerable<CarouselBeatmapSet> beatmapSets => root.Children.OfType<CarouselBeatmapSet>();
|
||||
|
||||
// todo: only used for testing, maybe remove.
|
||||
@ -171,7 +173,8 @@ namespace osu.Game.Screens.Select
|
||||
Scroll = new CarouselScrollContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
}
|
||||
},
|
||||
noResultsPlaceholder = new NoResultsPlaceholder()
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -649,8 +652,18 @@ namespace osu.Game.Screens.Select
|
||||
// First we iterate over all non-filtered carousel items and populate their
|
||||
// vertical position data.
|
||||
if (revalidateItems)
|
||||
{
|
||||
updateYPositions();
|
||||
|
||||
if (visibleItems.Count == 0)
|
||||
{
|
||||
noResultsPlaceholder.Filter = activeCriteria;
|
||||
noResultsPlaceholder.Show();
|
||||
}
|
||||
else
|
||||
noResultsPlaceholder.Hide();
|
||||
}
|
||||
|
||||
// if there is a pending scroll action we apply it without animation and transfer the difference in position to the panels.
|
||||
// this is intentionally applied before updating the visible range below, to avoid animating new items (sourced from pool) from locations off-screen, as it looks bad.
|
||||
if (pendingScrollOperation != PendingScrollOperation.None)
|
||||
|
Reference in New Issue
Block a user