Replace vertical scrolling in results screen with size-preserving container

This commit is contained in:
Salman Ahmed
2022-05-08 16:03:57 +03:00
parent 077c77d524
commit 298c2a1828
2 changed files with 5 additions and 27 deletions

View File

@ -46,9 +46,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
{ {
const float winner_background_half_height = 250; const float winner_background_half_height = 250;
VerticalScrollContent.Anchor = VerticalScrollContent.Origin = Anchor.TopCentre; Content.Anchor = Content.Origin = Anchor.TopCentre;
VerticalScrollContent.Scale = new Vector2(0.9f); Content.Scale = new Vector2(0.9f);
VerticalScrollContent.Y = 75; Content.Y = 75;
var redScore = teamScores.First().Value; var redScore = teamScores.First().Value;
var blueScore = teamScores.Last().Value; var blueScore = teamScores.Last().Value;

View File

@ -14,7 +14,6 @@ using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Input.Bindings; using osu.Game.Input.Bindings;
using osu.Game.Online.API; using osu.Game.Online.API;
@ -41,7 +40,7 @@ namespace osu.Game.Screens.Ranking
protected ScorePanelList ScorePanelList { get; private set; } protected ScorePanelList ScorePanelList { get; private set; }
protected VerticalScrollContainer VerticalScrollContent { get; private set; } protected Container Content { get; private set; }
[Resolved(CanBeNull = true)] [Resolved(CanBeNull = true)]
private Player player { get; set; } private Player player { get; set; }
@ -79,10 +78,9 @@ namespace osu.Game.Screens.Ranking
{ {
new Drawable[] new Drawable[]
{ {
VerticalScrollContent = new VerticalScrollContainer Content = new DrawSizePreservingFillContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
ScrollbarVisible = false,
Child = new Container Child = new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
@ -346,25 +344,5 @@ namespace osu.Game.Screens.Ranking
public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e) public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e)
{ {
} }
protected class VerticalScrollContainer : OsuScrollContainer
{
protected override Container<Drawable> Content => content;
private readonly Container content;
public VerticalScrollContainer()
{
Masking = false;
base.Content.Add(content = new Container { RelativeSizeAxes = Axes.X });
}
protected override void Update()
{
base.Update();
content.Height = Math.Max(screen_height, DrawHeight);
}
}
} }
} }