mirror of https://github.com/ppy/osu
Make OverlayTabControl inherited from OsuTabControl
This commit is contained in:
parent
843feb4e08
commit
178a72f9b8
|
@ -13,34 +13,14 @@
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
public abstract class OverlayTabControl<T> : TabControl<T>
|
public abstract class OverlayTabControl<T> : OsuTabControl<T>
|
||||||
{
|
{
|
||||||
private readonly Box bar;
|
private readonly Box bar;
|
||||||
|
|
||||||
private Color4 accentColour = Color4.White;
|
public new Color4 AccentColour
|
||||||
|
|
||||||
public Color4 AccentColour
|
|
||||||
{
|
{
|
||||||
get => accentColour;
|
get => base.AccentColour;
|
||||||
set
|
set => base.AccentColour = bar.Colour = value;
|
||||||
{
|
|
||||||
if (accentColour == value)
|
|
||||||
return;
|
|
||||||
|
|
||||||
accentColour = value;
|
|
||||||
bar.Colour = value;
|
|
||||||
|
|
||||||
foreach (TabItem<T> tabItem in TabContainer)
|
|
||||||
{
|
|
||||||
((OverlayTabItem)tabItem).AccentColour = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public new MarginPadding Padding
|
|
||||||
{
|
|
||||||
get => TabContainer.Padding;
|
|
||||||
set => TabContainer.Padding = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected float BarHeight
|
protected float BarHeight
|
||||||
|
@ -66,7 +46,7 @@ protected OverlayTabControl()
|
||||||
|
|
||||||
protected override TabItem<T> CreateTabItem(T value) => new OverlayTabItem(value);
|
protected override TabItem<T> CreateTabItem(T value) => new OverlayTabItem(value);
|
||||||
|
|
||||||
protected class OverlayTabItem : TabItem<T>
|
protected class OverlayTabItem : TabItem<T>, IHasAccentColour
|
||||||
{
|
{
|
||||||
protected readonly ExpandingBar Bar;
|
protected readonly ExpandingBar Bar;
|
||||||
protected readonly OsuSpriteText Text;
|
protected readonly OsuSpriteText Text;
|
||||||
|
|
Loading…
Reference in New Issue