mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Refactor into some kind of sanity
This commit is contained in:
@ -1,14 +1,39 @@
|
||||
// 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.Graphics;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public abstract class BreadcrumbControlOverlayHeader : OverlayHeader
|
||||
{
|
||||
protected OverlayHeaderBreadcrumbControl TabControl;
|
||||
protected OverlayHeaderBreadcrumbControl BreadcrumbControl;
|
||||
|
||||
protected override TabControl<string> CreateControl() => TabControl = new OverlayHeaderBreadcrumbControl();
|
||||
protected override TabControl<string> CreateTabControl() => BreadcrumbControl = new OverlayHeaderBreadcrumbControl();
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user