mirror of https://github.com/ppy/osu
Use `TransformImmediately` instead at beatmap listing search control
Applies two changes: - Use `TransformImmediately` which achieves the same wanted transition behaviour without any issues. - Move the transition behaviour override into `BeatmapListingSearchControl` in a nested subclass of `UpdateableBeatmapSetCover`.
This commit is contained in:
parent
2fd596d53c
commit
283488ea53
|
@ -41,10 +41,6 @@ public UpdateableBeatmapSetCover(BeatmapSetCoverType coverType = BeatmapSetCover
|
|||
protected override DelayedLoadWrapper CreateDelayedLoadWrapper(Func<Drawable> createContentFunc, double timeBeforeLoad)
|
||||
=> new DelayedLoadUnloadWrapper(createContentFunc, timeBeforeLoad);
|
||||
|
||||
// by default, ModelBackedDrawable hides the old drawable only after the new one has been fully loaded.
|
||||
// this can lead to weird appearance if the cover is not fully opaque, so fade out as soon as a new load is requested in this particular case.
|
||||
protected override void OnLoadStarted() => ApplyHideTransforms(DisplayedDrawable);
|
||||
|
||||
protected override Drawable CreateDrawable(BeatmapSetInfo model)
|
||||
{
|
||||
if (model == null)
|
||||
|
|
|
@ -90,7 +90,7 @@ public BeatmapListingSearchControl()
|
|||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Masking = true,
|
||||
Child = beatmapCover = new UpdateableBeatmapSetCover
|
||||
Child = beatmapCover = new TopSearchBeatmapSetCover
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Alpha = 0,
|
||||
|
@ -184,5 +184,10 @@ protected override bool OnKeyDown(KeyDownEvent e)
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private class TopSearchBeatmapSetCover : UpdateableBeatmapSetCover
|
||||
{
|
||||
protected override bool TransformImmediately => true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue