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).
This commit is contained in:
Salman Ahmed 2024-06-27 07:09:46 +03:00
parent e4335a543e
commit 811621325f
1 changed files with 10 additions and 7 deletions

View File

@ -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<GlobalAction> 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;
}
}
}