mirror of
https://github.com/ppy/osu.git
synced 2025-03-19 00:37:20 +08:00
Applied suggestions
This commit is contained in:
parent
1ce4966644
commit
700c7753c3
@ -129,11 +129,10 @@ namespace osu.Game.Screens.Select
|
||||
Right = left_area_padding,
|
||||
},
|
||||
});
|
||||
Add(new ActionContainer
|
||||
Add(new ResetScrollContainer(() => carousel.ScrollToSelected())
|
||||
{
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Width = 250,
|
||||
OnHoverAction = () => carousel.ScrollToSelected(),
|
||||
});
|
||||
|
||||
if (ShowFooter)
|
||||
@ -416,13 +415,18 @@ namespace osu.Game.Screens.Select
|
||||
return base.OnKeyDown(state, args);
|
||||
}
|
||||
|
||||
private class ActionContainer : Container
|
||||
private class ResetScrollContainer : Container
|
||||
{
|
||||
public Action OnHoverAction;
|
||||
private readonly Action onHoverAction;
|
||||
|
||||
public ResetScrollContainer(Action onHoverAction)
|
||||
{
|
||||
this.onHoverAction = onHoverAction;
|
||||
}
|
||||
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
OnHoverAction?.Invoke();
|
||||
onHoverAction?.Invoke();
|
||||
return base.OnHover(state);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user