From 811621325f2746df0947e673381351377ee4bfe7 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Thu, 27 Jun 2024 07:09:46 +0300 Subject: [PATCH] Fix osu! dropdown search text box having commits disabled I've also removed inheritance from `SearchTextBox` because it contains logic that might interfere with the internal implementation of dropdown search bars (focus logic and stuff). --- osu.Game/Graphics/UserInterface/OsuDropdown.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuDropdown.cs b/osu.Game/Graphics/UserInterface/OsuDropdown.cs index 38e90bf4ea..c8bb45b59d 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropdown.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropdown.cs @@ -418,16 +418,19 @@ private partial class OsuDropdownSearchBar : DropdownSearchBar FontSize = OsuFont.Default.Size, }; - private partial class DropdownSearchTextBox : SearchTextBox + private partial class DropdownSearchTextBox : OsuTextBox { - public override bool OnPressed(KeyBindingPressEvent e) + [BackgroundDependencyLoader] + private void load(OverlayColourProvider? colourProvider) { - if (e.Action == GlobalAction.Back) - // this method is blocking Dropdown from receiving the back action, despite this text box residing in a separate input manager. - // to fix this properly, a local global action container needs to be added as well, but for simplicity, just don't handle the back action here. - return false; + BackgroundUnfocused = colourProvider?.Background5 ?? new Color4(10, 10, 10, 255); + BackgroundFocused = colourProvider?.Background5 ?? new Color4(10, 10, 10, 255); + } - return base.OnPressed(e); + protected override void OnFocus(FocusEvent e) + { + base.OnFocus(e); + BorderThickness = 0; } } }