mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Add tests for (and fix) removal of last item in carousel
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Logging;
|
||||
|
||||
namespace osu.Game.Screens.Select.Carousel
|
||||
{
|
||||
@ -48,6 +49,8 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
{
|
||||
if (InternalChildren == null) return;
|
||||
|
||||
Logger.Log($"State changed to {v}");
|
||||
|
||||
switch (v)
|
||||
{
|
||||
case CarouselItemState.Hidden:
|
||||
@ -56,6 +59,12 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
Filtered.ValueChanged += v =>
|
||||
{
|
||||
if (v && State == CarouselItemState.Selected)
|
||||
State.Value = CarouselItemState.NotSelected;
|
||||
};
|
||||
}
|
||||
|
||||
private readonly Lazy<DrawableCarouselItem> drawableRepresentation;
|
||||
|
Reference in New Issue
Block a user