diff --git a/osu.Game/Graphics/UserInterface/GradientLineTabControl.cs b/osu.Game/Graphics/UserInterface/GradientLineTabControl.cs index 7cd8d2c5bd..3523876fca 100644 --- a/osu.Game/Graphics/UserInterface/GradientLineTabControl.cs +++ b/osu.Game/Graphics/UserInterface/GradientLineTabControl.cs @@ -8,7 +8,6 @@ using osuTK; using osu.Framework.Graphics.Shapes; using osuTK.Graphics; using osu.Framework.Graphics.Colour; -using osu.Framework.Bindables; using osu.Framework.Extensions.Color4Extensions; namespace osu.Game.Graphics.UserInterface @@ -19,8 +18,8 @@ namespace osu.Game.Graphics.UserInterface protected Color4 LineColour { - get => line.MainColour.Value; - set => line.MainColour.Value = value; + get => line.Colour; + set => line.Colour = value; } private readonly GradientLine line; @@ -48,12 +47,6 @@ namespace osu.Game.Graphics.UserInterface private class GradientLine : GridContainer { - public readonly Bindable MainColour = new Bindable(); - - private readonly Box left; - private readonly Box middle; - private readonly Box right; - public GradientLine() { RelativeSizeAxes = Axes.X; @@ -70,34 +63,23 @@ namespace osu.Game.Graphics.UserInterface { new Drawable[] { - left = new Box + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = ColourInfo.GradientHorizontal(Color4.White.Opacity(0), Color4.White) + }, + new Box { RelativeSizeAxes = Axes.Both, }, - middle = new Box - { - RelativeSizeAxes = Axes.Both, - }, - right = new Box + new Box { RelativeSizeAxes = Axes.Both, + Colour = ColourInfo.GradientHorizontal(Color4.White, Color4.White.Opacity(0)) }, } }; } - - protected override void LoadComplete() - { - MainColour.BindValueChanged(onColourChanged, true); - base.LoadComplete(); - } - - private void onColourChanged(ValueChangedEvent colour) - { - left.Colour = ColourInfo.GradientHorizontal(colour.NewValue.Opacity(0), colour.NewValue); - middle.Colour = colour.NewValue; - right.Colour = ColourInfo.GradientHorizontal(colour.NewValue, colour.NewValue.Opacity(0)); - } } } }