1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 18:32:56 +08:00

Fix mod search textbox having focus while settings are visible

Stopped arrow key adjust on slider bars from working.

Also just felt wrong that you could type into an off-screen textbox.
This commit is contained in:
Dean Herbert 2023-12-19 01:32:30 +09:00
parent c466775f78
commit 51f4c7254c
No known key found for this signature in database
2 changed files with 10 additions and 5 deletions

View File

@ -508,6 +508,11 @@ namespace osu.Game.Overlays.Mods
modSettingsArea.ResizeHeightTo(modAreaHeight, transition_duration, Easing.InOutCubic);
TopLevelContent.MoveToY(-modAreaHeight, transition_duration, Easing.InOutCubic);
if (customisationVisible.Value)
GetContainingInputManager().ChangeFocus(modSettingsArea);
else
Scheduler.Add(() => GetContainingInputManager().ChangeFocus(null));
}
/// <summary>
@ -622,7 +627,7 @@ namespace osu.Game.Overlays.Mods
}
if (textSearchStartsActive.Value)
SearchTextBox.TakeFocus();
SearchTextBox.HoldFocus = true;
}
protected override void PopOut()
@ -761,11 +766,9 @@ namespace osu.Game.Overlays.Mods
return false;
// TODO: should probably eventually support typical platform search shortcuts (`Ctrl-F`, `/`)
if (SearchTextBox.HasFocus)
SearchTextBox.KillFocus();
else
SearchTextBox.HoldFocus = !SearchTextBox.HoldFocus;
if (SearchTextBox.HoldFocus)
SearchTextBox.TakeFocus();
return true;
}

View File

@ -32,6 +32,8 @@ namespace osu.Game.Overlays.Mods
[Resolved]
private OverlayColourProvider colourProvider { get; set; } = null!;
public override bool AcceptsFocus => true;
public ModSettingsArea()
{
RelativeSizeAxes = Axes.X;