From 48cbec7a319383a892d1dc12d99c8d33a5748d3e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 17 Mar 2020 22:21:16 +0900 Subject: [PATCH] Add scroll view because --- osu.Game/Screens/Ranking/ResultsScreen.cs | 36 ++++++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Ranking/ResultsScreen.cs b/osu.Game/Screens/Ranking/ResultsScreen.cs index 89547fc5dc..6f8b5d19df 100644 --- a/osu.Game/Screens/Ranking/ResultsScreen.cs +++ b/osu.Game/Screens/Ranking/ResultsScreen.cs @@ -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 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; + } + } } }