1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-05 10:23:20 +08:00

Add scroll view because

This commit is contained in:
Dean Herbert 2020-03-17 22:21:16 +09:00
parent 2d6dcb3ba9
commit 48cbec7a31

View File

@ -7,6 +7,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Screens;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using osu.Game.Scoring;
using osu.Game.Screens.Backgrounds;
@ -43,11 +44,14 @@ namespace osu.Game.Screens.Ranking
{
InternalChildren = new[]
{
new ScorePanel(score)
new ResultsScrollContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
State = PanelState.Expanded
Child = new ScorePanel(score)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
State = PanelState.Expanded
},
},
bottomPanel = new Container
{
@ -110,5 +114,29 @@ namespace osu.Game.Screens.Ranking
return base.OnExiting(next);
}
private class ResultsScrollContainer : OsuScrollContainer
{
private readonly Container content;
protected override Container<Drawable> Content => content;
public ResultsScrollContainer()
{
base.Content.Add(content = new Container
{
RelativeSizeAxes = Axes.X
});
RelativeSizeAxes = Axes.Both;
ScrollbarVisible = false;
}
protected override void Update()
{
base.Update();
content.Height = DrawHeight;
}
}
}
}