mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:33:30 +08:00
Update header breadcrumb tab control
This commit is contained in:
parent
46ebf6ef78
commit
da996ffe74
@ -1,6 +1,7 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
@ -16,6 +17,13 @@ namespace osu.Game.Overlays
|
||||
public OverlayHeaderBreadcrumbControl()
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Height = 47;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
{
|
||||
AccentColour = colourProvider.Light2;
|
||||
}
|
||||
|
||||
protected override TabItem<string> CreateTabItem(string value) => new ControlTabItem(value);
|
||||
@ -27,10 +35,18 @@ namespace osu.Game.Overlays
|
||||
public ControlTabItem(string value)
|
||||
: base(value)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Y;
|
||||
Text.Font = Text.Font.With(size: 14);
|
||||
Chevron.Y = 3;
|
||||
Text.Anchor = Anchor.CentreLeft;
|
||||
Text.Origin = Anchor.CentreLeft;
|
||||
Chevron.Y = 1;
|
||||
Bar.Height = 0;
|
||||
}
|
||||
|
||||
// base OsuTabItem makes font bold on activation, we don't want that here
|
||||
protected override void OnActivated() => FadeHovered();
|
||||
|
||||
protected override void OnDeactivated() => FadeUnhovered();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user