1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00

Move background creation out from UpdateStreamBadgeArea

This commit is contained in:
Andrei Zavatski 2020-02-27 14:39:10 +03:00
parent 7c0e823b95
commit d92e93ed31
2 changed files with 15 additions and 10 deletions

View File

@ -4,9 +4,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API.Requests.Responses;
@ -22,6 +24,8 @@ namespace osu.Game.Overlays.Changelog
private const string listing_string = "listing";
private Box streamsBackground;
public ChangelogHeader()
{
TabControl.AddItem(listing_string);
@ -40,6 +44,12 @@ namespace osu.Game.Overlays.Changelog
};
}
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
streamsBackground.Colour = colourProvider.Background5;
}
private ChangelogHeaderTitle title;
private void showBuild(ValueChangedEvent<APIChangelogBuild> e)
@ -72,6 +82,10 @@ namespace osu.Game.Overlays.Changelog
AutoSizeAxes = Axes.Y,
Children = new Drawable[]
{
streamsBackground = new Box
{
RelativeSizeAxes = Axes.Both
},
Streams = new UpdateStreamBadgeArea(),
}
};

View File

@ -6,25 +6,16 @@ using osu.Framework.Input.Events;
using osu.Game.Online.API.Requests.Responses;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Allocation;
namespace osu.Game.Overlays.Changelog
{
public class UpdateStreamBadgeArea : TabControl<APIUpdateStream>
{
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
public UpdateStreamBadgeArea()
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
AddInternal(new Box
{
RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background5,
});
}
public void Populate(List<APIUpdateStream> streams)