1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 08:43:20 +08:00

Recolour info section

This commit is contained in:
Andrei Zavatski 2020-02-04 14:00:18 +03:00
parent 27c24fb08a
commit 873eda3bb5
2 changed files with 12 additions and 20 deletions

View File

@ -24,6 +24,7 @@ namespace osu.Game.Overlays.BeatmapSet
private const float spacing = 20; private const float spacing = 20;
private readonly Box successRateBackground; private readonly Box successRateBackground;
private readonly Box background;
private readonly SuccessRate successRate; private readonly SuccessRate successRate;
public readonly Bindable<BeatmapSetInfo> BeatmapSet = new Bindable<BeatmapSetInfo>(); public readonly Bindable<BeatmapSetInfo> BeatmapSet = new Bindable<BeatmapSetInfo>();
@ -50,10 +51,9 @@ namespace osu.Game.Overlays.BeatmapSet
Children = new Drawable[] Children = new Drawable[]
{ {
new Box background = new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both
Colour = Color4.White,
}, },
new Container new Container
{ {
@ -126,14 +126,14 @@ namespace osu.Game.Overlays.BeatmapSet
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OverlayColourProvider colourProvider)
{ {
successRateBackground.Colour = colours.GrayE; successRateBackground.Colour = colourProvider.Background4;
background.Colour = colourProvider.Background5;
} }
private class MetadataSection : FillFlowContainer private class MetadataSection : FillFlowContainer
{ {
private readonly OsuSpriteText header;
private readonly TextFlowContainer textFlow; private readonly TextFlowContainer textFlow;
public string Text public string Text
@ -148,7 +148,7 @@ namespace osu.Game.Overlays.BeatmapSet
this.FadeIn(transition_duration); this.FadeIn(transition_duration);
textFlow.Clear(); textFlow.Clear();
textFlow.AddText(value, s => s.Font = s.Font.With(size: 14)); textFlow.AddText(value, s => s.Font = s.Font.With(size: 12));
} }
} }
@ -160,11 +160,10 @@ namespace osu.Game.Overlays.BeatmapSet
InternalChildren = new Drawable[] InternalChildren = new Drawable[]
{ {
header = new OsuSpriteText new OsuSpriteText
{ {
Text = title, Text = title,
Font = OsuFont.GetFont(size: 14, weight: FontWeight.Bold), Font = OsuFont.GetFont(size: 14, weight: FontWeight.Black),
Shadow = false,
Margin = new MarginPadding { Top = 20 }, Margin = new MarginPadding { Top = 20 },
}, },
textFlow = new OsuTextFlowContainer textFlow = new OsuTextFlowContainer
@ -174,12 +173,6 @@ namespace osu.Game.Overlays.BeatmapSet
}, },
}; };
} }
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
header.Colour = textFlow.Colour = colours.Gray5;
}
} }
} }
} }

View File

@ -17,7 +17,7 @@ namespace osu.Game.Overlays.BeatmapSet
protected readonly FailRetryGraph Graph; protected readonly FailRetryGraph Graph;
private readonly FillFlowContainer header; private readonly FillFlowContainer header;
private readonly OsuSpriteText successRateLabel, successPercent, graphLabel; private readonly OsuSpriteText successPercent;
private readonly Bar successRate; private readonly Bar successRate;
private readonly Container percentContainer; private readonly Container percentContainer;
@ -60,7 +60,7 @@ namespace osu.Game.Overlays.BeatmapSet
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Children = new Drawable[] Children = new Drawable[]
{ {
successRateLabel = new OsuSpriteText new OsuSpriteText
{ {
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
@ -85,7 +85,7 @@ namespace osu.Game.Overlays.BeatmapSet
Font = OsuFont.GetFont(size: 13), Font = OsuFont.GetFont(size: 13),
}, },
}, },
graphLabel = new OsuSpriteText new OsuSpriteText
{ {
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
@ -107,7 +107,6 @@ namespace osu.Game.Overlays.BeatmapSet
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
successRateLabel.Colour = successPercent.Colour = graphLabel.Colour = colours.Gray5;
successRate.AccentColour = colours.Green; successRate.AccentColour = colours.Green;
successRate.BackgroundColour = colours.GrayD; successRate.BackgroundColour = colours.GrayD;