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.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Scoring; using osu.Game.Scoring;
using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Backgrounds;
@ -43,11 +44,14 @@ namespace osu.Game.Screens.Ranking
{ {
InternalChildren = new[] InternalChildren = new[]
{ {
new ScorePanel(score) new ResultsScrollContainer
{ {
Anchor = Anchor.Centre, Child = new ScorePanel(score)
Origin = Anchor.Centre, {
State = PanelState.Expanded Anchor = Anchor.Centre,
Origin = Anchor.Centre,
State = PanelState.Expanded
},
}, },
bottomPanel = new Container bottomPanel = new Container
{ {
@ -110,5 +114,29 @@ namespace osu.Game.Screens.Ranking
return base.OnExiting(next); 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;
}
}
} }
} }