From 82d944dc899505f6d56b6f529cb2e1447490e664 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 25 Jan 2019 19:10:11 +0900 Subject: [PATCH] Fix textbox colours not always being set corrrectly --- osu.Game/Overlays/Music/FilterControl.cs | 12 ++---------- .../SearchableList/SearchableListFilterControl.cs | 13 +++---------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/osu.Game/Overlays/Music/FilterControl.cs b/osu.Game/Overlays/Music/FilterControl.cs index ea18c9bb2c..c2c10d999f 100644 --- a/osu.Game/Overlays/Music/FilterControl.cs +++ b/osu.Game/Overlays/Music/FilterControl.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics; @@ -53,10 +52,9 @@ public FilterControl() public class FilterTextBox : SearchTextBox { - private Color4 backgroundColour; + protected override Color4 BackgroundUnfocused => OsuColour.Gray(0.06f); + protected override Color4 BackgroundFocused => OsuColour.Gray(0.12f); - protected override Color4 BackgroundUnfocused => backgroundColour; - protected override Color4 BackgroundFocused => backgroundColour; protected override bool AllowCommit => true; public FilterTextBox() @@ -64,12 +62,6 @@ public FilterTextBox() Masking = true; CornerRadius = 5; } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - backgroundColour = colours.Gray2; - } } } } diff --git a/osu.Game/Overlays/SearchableList/SearchableListFilterControl.cs b/osu.Game/Overlays/SearchableList/SearchableListFilterControl.cs index f679e0186a..478e3d4c95 100644 --- a/osu.Game/Overlays/SearchableList/SearchableListFilterControl.cs +++ b/osu.Game/Overlays/SearchableList/SearchableListFilterControl.cs @@ -127,17 +127,10 @@ protected override void Update() private class FilterSearchTextBox : SearchTextBox { - protected override Color4 BackgroundUnfocused => backgroundColour; - protected override Color4 BackgroundFocused => backgroundColour; + protected override Color4 BackgroundUnfocused => OsuColour.Gray(0.06f); + protected override Color4 BackgroundFocused => OsuColour.Gray(0.12f); + protected override bool AllowCommit => true; - - private Color4 backgroundColour; - - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - backgroundColour = colours.Gray2.Opacity(0.9f); - } } } }