From e5b50b5e1fda974c7e47ec5be852ff0ec98bcf63 Mon Sep 17 00:00:00 2001 From: Joehu Date: Thu, 17 Oct 2019 13:54:36 -0700 Subject: [PATCH] Fix slider bar regression when using arrows --- osu.Game/Graphics/UserInterface/FixedSearchTextBox.cs | 10 ++++++++++ osu.Game/Overlays/SettingsPanel.cs | 4 ++-- osu.Game/Screens/Select/FilterControl.cs | 9 ++------- 3 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 osu.Game/Graphics/UserInterface/FixedSearchTextBox.cs diff --git a/osu.Game/Graphics/UserInterface/FixedSearchTextBox.cs b/osu.Game/Graphics/UserInterface/FixedSearchTextBox.cs new file mode 100644 index 0000000000..0654746a6e --- /dev/null +++ b/osu.Game/Graphics/UserInterface/FixedSearchTextBox.cs @@ -0,0 +1,10 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +namespace osu.Game.Graphics.UserInterface +{ + public class FixedSearchTextBox : SearchTextBox + { + public override bool HandleLeftRightArrows => false; + } +} diff --git a/osu.Game/Overlays/SettingsPanel.cs b/osu.Game/Overlays/SettingsPanel.cs index 37e7b62483..119b9a2b8c 100644 --- a/osu.Game/Overlays/SettingsPanel.cs +++ b/osu.Game/Overlays/SettingsPanel.cs @@ -37,7 +37,7 @@ public abstract class SettingsPanel : OsuFocusedOverlayContainer protected SettingsSectionsContainer SectionsContainer; - private SearchTextBox searchTextBox; + private FixedSearchTextBox searchTextBox; /// /// Provide a source for the toolbar height. @@ -80,7 +80,7 @@ private void load() Masking = true, RelativeSizeAxes = Axes.Both, ExpandableHeader = CreateHeader(), - FixedHeader = searchTextBox = new SearchTextBox + FixedHeader = searchTextBox = new FixedSearchTextBox { RelativeSizeAxes = Axes.X, Origin = Anchor.TopCentre, diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index 2c878f8d90..7aca11da2f 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -49,7 +49,7 @@ public FilterCriteria CreateCriteria() return criteria; } - private readonly SongSelectTextBox searchTextBox; + private readonly FixedSearchTextBox searchTextBox; public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => base.ReceivePositionalInputAt(screenSpacePos) || groupTabs.ReceivePositionalInputAt(screenSpacePos) || sortTabs.ReceivePositionalInputAt(screenSpacePos); @@ -73,7 +73,7 @@ public FilterControl() Origin = Anchor.TopRight, Children = new Drawable[] { - searchTextBox = new SongSelectTextBox { RelativeSizeAxes = Axes.X }, + searchTextBox = new FixedSearchTextBox { RelativeSizeAxes = Axes.X }, new Box { RelativeSizeAxes = Axes.X, @@ -170,10 +170,5 @@ private void load(OsuColour colours, IBindable parentRuleset, OsuCo } private void updateCriteria() => FilterChanged?.Invoke(CreateCriteria()); - - private class SongSelectTextBox : SearchTextBox - { - public override bool HandleLeftRightArrows => false; - } } }