2019-12-28 09:57:41 +08:00
|
|
|
|
// 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.
|
|
|
|
|
|
2020-01-16 03:41:22 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
2020-01-03 14:01:42 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2019-12-31 23:12:03 +08:00
|
|
|
|
using osu.Framework.Graphics.UserInterface;
|
2020-01-03 14:01:42 +08:00
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
2019-12-31 23:12:03 +08:00
|
|
|
|
|
2019-12-28 09:57:41 +08:00
|
|
|
|
namespace osu.Game.Overlays
|
|
|
|
|
{
|
2019-12-31 23:12:03 +08:00
|
|
|
|
public abstract class BreadcrumbControlOverlayHeader : OverlayHeader
|
2019-12-28 09:57:41 +08:00
|
|
|
|
{
|
2020-01-03 14:01:42 +08:00
|
|
|
|
protected OverlayHeaderBreadcrumbControl BreadcrumbControl;
|
2019-12-31 23:12:03 +08:00
|
|
|
|
|
2020-01-03 14:01:42 +08:00
|
|
|
|
protected override TabControl<string> CreateTabControl() => BreadcrumbControl = new OverlayHeaderBreadcrumbControl();
|
|
|
|
|
|
2020-01-16 03:41:22 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
2020-01-24 17:33:34 +08:00
|
|
|
|
private void load(OverlayColourProvider colourProvider)
|
2020-01-16 03:41:22 +08:00
|
|
|
|
{
|
2020-01-24 17:33:34 +08:00
|
|
|
|
BreadcrumbControl.AccentColour = colourProvider.Highlight1;
|
2020-01-16 03:41:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
2020-01-03 14:01:42 +08:00
|
|
|
|
public class OverlayHeaderBreadcrumbControl : BreadcrumbControl<string>
|
|
|
|
|
{
|
|
|
|
|
public OverlayHeaderBreadcrumbControl()
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override TabItem<string> CreateTabItem(string value) => new ControlTabItem(value);
|
|
|
|
|
|
|
|
|
|
private class ControlTabItem : BreadcrumbTabItem
|
|
|
|
|
{
|
|
|
|
|
protected override float ChevronSize => 8;
|
|
|
|
|
|
|
|
|
|
public ControlTabItem(string value)
|
|
|
|
|
: base(value)
|
|
|
|
|
{
|
|
|
|
|
Text.Font = Text.Font.With(size: 14);
|
|
|
|
|
Chevron.Y = 3;
|
|
|
|
|
Bar.Height = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-12-28 09:57:41 +08:00
|
|
|
|
}
|
|
|
|
|
}
|