From cab59960f1d46e4a932ff86c003c05a1500b8653 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 25 Jan 2019 18:38:07 +0900 Subject: [PATCH] More focus hacks --- osu.Game/Graphics/UserInterface/SearchTextBox.cs | 1 + osu.Game/Overlays/ChatOverlay.cs | 2 +- osu.Game/Overlays/Music/FilterControl.cs | 12 ++---------- .../SearchableList/SearchableListFilterControl.cs | 5 +++-- .../Overlays/SearchableList/SearchableListOverlay.cs | 2 +- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/SearchTextBox.cs b/osu.Game/Graphics/UserInterface/SearchTextBox.cs index 54bb968d21..eaa7b303ba 100644 --- a/osu.Game/Graphics/UserInterface/SearchTextBox.cs +++ b/osu.Game/Graphics/UserInterface/SearchTextBox.cs @@ -17,6 +17,7 @@ namespace osu.Game.Graphics.UserInterface public SearchTextBox() { Height = 35; + AddRange(new Drawable[] { new SpriteIcon diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 74edf48433..5b3a1ef641 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -302,7 +302,7 @@ namespace osu.Game.Overlays protected override void OnFocus(FocusEvent e) { //this is necessary as textbox is masked away and therefore can't get focus :( - GetContainingInputManager().ChangeFocus(textbox); + //GetContainingInputManager().ChangeFocus(textbox); base.OnFocus(e); } 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 @@ namespace osu.Game.Overlays.Music 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 @@ namespace osu.Game.Overlays.Music 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..ad84c9af56 100644 --- a/osu.Game/Overlays/SearchableList/SearchableListFilterControl.cs +++ b/osu.Game/Overlays/SearchableList/SearchableListFilterControl.cs @@ -127,8 +127,9 @@ namespace osu.Game.Overlays.SearchableList 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; diff --git a/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs b/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs index ecb610c1f4..9bdf20fe9b 100644 --- a/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs +++ b/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs @@ -103,7 +103,7 @@ namespace osu.Game.Overlays.SearchableList protected override void OnFocus(FocusEvent e) { - GetContainingInputManager().ChangeFocus(Filter.Search); + //GetContainingInputManager().ChangeFocus(Filter.Search); } protected override void PopIn()