Fix scroll container height on smaller ui scales

This commit is contained in:
smoogipoo 2020-06-30 16:36:53 +09:00
parent 50ae69b111
commit 1701c844a6

View File

@ -70,41 +70,33 @@ namespace osu.Game.Screens.Ranking
{ {
new Drawable[] new Drawable[]
{ {
new Container new VerticalScrollContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Children = new Drawable[] ScrollbarVisible = false,
Child = new Container
{ {
new OsuScrollContainer RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{ {
RelativeSizeAxes = Axes.Both, scorePanelList = new ScorePanelList
ScrollbarVisible = false,
Child = new Container
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.Both,
Height = screen_height, SelectedScore = { BindTarget = SelectedScore },
Children = new Drawable[] PostExpandAction = () => statisticsPanel.ToggleVisibility()
{ },
scorePanelList = new ScorePanelList detachedPanelContainer = new Container<ScorePanel>
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both
SelectedScore = { BindTarget = SelectedScore }, },
PostExpandAction = () => statisticsPanel.ToggleVisibility() statisticsPanel = new StatisticsPanel
}, {
detachedPanelContainer = new Container<ScorePanel> RelativeSizeAxes = Axes.Both,
{ Score = { BindTarget = SelectedScore }
RelativeSizeAxes = Axes.Both },
}, }
statisticsPanel = new StatisticsPanel
{
RelativeSizeAxes = Axes.Both,
Score = { BindTarget = SelectedScore }
},
}
}
},
} }
} },
}, },
new[] new[]
{ {
@ -277,5 +269,23 @@ namespace osu.Game.Screens.Ranking
detachedPanel = null; detachedPanel = null;
} }
} }
private class VerticalScrollContainer : OsuScrollContainer
{
protected override Container<Drawable> Content => content;
private readonly Container content;
public VerticalScrollContainer()
{
base.Content.Add(content = new Container { RelativeSizeAxes = Axes.X });
}
protected override void Update()
{
base.Update();
content.Height = Math.Max(screen_height, DrawHeight);
}
}
} }
} }