mirror of
https://github.com/ppy/osu
synced 2024-12-27 01:12:45 +00:00
Use textbox focus state directly rather than trying to track it independently
This commit is contained in:
parent
9d04b44a88
commit
2dcbb823ef
@ -143,8 +143,6 @@ namespace osu.Game.Overlays.Mods
|
||||
protected ShearedToggleButton? CustomisationButton { get; private set; }
|
||||
protected SelectAllModsButton? SelectAllModsButton { get; set; }
|
||||
|
||||
private bool textBoxShouldFocus;
|
||||
|
||||
private Sample? columnAppearSample;
|
||||
|
||||
private WorkingBeatmap? beatmap;
|
||||
@ -542,7 +540,7 @@ namespace osu.Game.Overlays.Mods
|
||||
if (customisationVisible.Value)
|
||||
SearchTextBox.KillFocus();
|
||||
else
|
||||
setTextBoxFocus(textBoxShouldFocus);
|
||||
setTextBoxFocus(textSearchStartsActive.Value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -798,15 +796,13 @@ namespace osu.Game.Overlays.Mods
|
||||
return false;
|
||||
|
||||
// TODO: should probably eventually support typical platform search shortcuts (`Ctrl-F`, `/`)
|
||||
setTextBoxFocus(!textBoxShouldFocus);
|
||||
setTextBoxFocus(!SearchTextBox.HasFocus);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void setTextBoxFocus(bool keepFocus)
|
||||
private void setTextBoxFocus(bool focus)
|
||||
{
|
||||
textBoxShouldFocus = keepFocus;
|
||||
|
||||
if (textBoxShouldFocus)
|
||||
if (focus)
|
||||
SearchTextBox.TakeFocus();
|
||||
else
|
||||
SearchTextBox.KillFocus();
|
||||
|
Loading…
Reference in New Issue
Block a user