1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 23:23:30 +08:00

Recolour rankings tables

This commit is contained in:
Andrei Zavatski 2020-02-03 21:22:37 +03:00
parent f7cbb8c1f7
commit 824ee8a888
3 changed files with 14 additions and 11 deletions

View File

@ -16,6 +16,7 @@ using osu.Game.Rulesets.Mania;
using osu.Game.Rulesets.Taiko;
using osu.Game.Rulesets.Catch;
using osu.Framework.Allocation;
using osu.Game.Overlays;
namespace osu.Game.Tests.Visual.Online
{
@ -36,6 +37,9 @@ namespace osu.Game.Tests.Visual.Online
[Resolved]
private IAPIProvider api { get; set; }
[Cached]
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Green);
private readonly BasicScrollContainer scrollFlow;
private readonly DimmedLoadingLayer loading;
private CancellationTokenSource cancellationToken;

View File

@ -18,7 +18,7 @@ namespace osu.Game.Overlays.Rankings.Tables
{
public abstract class RankingsTable<TModel> : TableContainer
{
protected const int TEXT_SIZE = 14;
protected const int TEXT_SIZE = 12;
private const float horizontal_inset = 20;
private const float row_height = 25;
private const int items_per_page = 50;
@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Rankings.Tables
private static TableColumn[] mainHeaders => new[]
{
new TableColumn(string.Empty, Anchor.Centre, new Dimension(GridSizeMode.Absolute, 50)), // place
new TableColumn(string.Empty, Anchor.Centre, new Dimension(GridSizeMode.Absolute, 40)), // place
new TableColumn(string.Empty, Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed)), // flag and username (country name)
};
@ -77,7 +77,7 @@ namespace osu.Game.Overlays.Rankings.Tables
private OsuSpriteText createIndexDrawable(int index) => new OsuSpriteText
{
Text = $"#{index + 1}",
Font = OsuFont.GetFont(size: TEXT_SIZE, weight: FontWeight.Bold)
Font = OsuFont.GetFont(size: TEXT_SIZE, weight: FontWeight.SemiBold)
};
private FillFlowContainer createMainContent(TModel item) => new FillFlowContainer
@ -112,10 +112,10 @@ namespace osu.Game.Overlays.Rankings.Tables
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load(OverlayColourProvider colourProvider)
{
if (Text != highlighted)
Colour = colours.GreySeafoamLighter;
Colour = colourProvider.Foreground1;
}
}
@ -131,9 +131,9 @@ namespace osu.Game.Overlays.Rankings.Tables
protected class ColoredRowText : RowText
{
[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load(OverlayColourProvider colourProvider)
{
Colour = colours.GreySeafoamLighter;
Colour = colourProvider.Foreground1;
}
}
}

View File

@ -6,7 +6,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osuTK.Graphics;
namespace osu.Game.Overlays.Rankings.Tables
@ -35,10 +34,10 @@ namespace osu.Game.Overlays.Rankings.Tables
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load(OverlayColourProvider colourProvider)
{
background.Colour = idleColour = colours.GreySeafoam;
hoverColour = colours.GreySeafoamLight;
background.Colour = idleColour = colourProvider.Background4;
hoverColour = colourProvider.Background3;
}
protected override bool OnHover(HoverEvent e)