diff --git a/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs b/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs index a7cc5d5fd6..aa99141e45 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs @@ -11,6 +11,8 @@ using osu.Framework.Configuration; using OpenTK; using OpenTK.Graphics; using osu.Framework.MathUtils; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Transformations; namespace osu.Desktop.VisualTests.Tests { @@ -44,7 +46,7 @@ namespace osu.Desktop.VisualTests.Tests Key key = (Key)((int)Key.A + RNG.Next(26)); kc.Add(new KeyCounterKeyboard(key.ToString(), key)); }); - ButtonsContainer.Add(new SliderBar + ButtonsContainer.Add(new TestSliderBar { Width = 150, Height = 10, @@ -53,5 +55,38 @@ namespace osu.Desktop.VisualTests.Tests }); Add(kc); } + private class TestSliderBar : SliderBar where T : struct + { + public Color4 Color + { + get { return Box.Colour; } + set { Box.Colour = value; } + } + + public Color4 SelectionColor + { + get { return SelectionBox.Colour; } + set { SelectionBox.Colour = value; } + } + + protected readonly Box SelectionBox; + protected readonly Box Box; + + public TestSliderBar() + { + Children = new Drawable[] + { + Box = new Box { RelativeSizeAxes = Axes.Both }, + SelectionBox = new Box { RelativeSizeAxes = Axes.Both } + }; + } + + protected override void UpdateValue(float value) + { + SelectionBox.ScaleTo( + new Vector2(value, 1), + 300, EasingTypes.OutQuint); + } + } } }