mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 08:02:55 +08:00
Revert to using a more manual approach to holding focus
This commit is contained in:
parent
51f4c7254c
commit
c556475c2c
@ -132,6 +132,8 @@ 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;
|
||||
@ -510,9 +512,9 @@ namespace osu.Game.Overlays.Mods
|
||||
TopLevelContent.MoveToY(-modAreaHeight, transition_duration, Easing.InOutCubic);
|
||||
|
||||
if (customisationVisible.Value)
|
||||
GetContainingInputManager().ChangeFocus(modSettingsArea);
|
||||
SearchTextBox.KillFocus();
|
||||
else
|
||||
Scheduler.Add(() => GetContainingInputManager().ChangeFocus(null));
|
||||
setTextBoxFocus(textBoxShouldFocus);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -626,8 +628,7 @@ namespace osu.Game.Overlays.Mods
|
||||
nonFilteredColumnCount += 1;
|
||||
}
|
||||
|
||||
if (textSearchStartsActive.Value)
|
||||
SearchTextBox.HoldFocus = true;
|
||||
setTextBoxFocus(textSearchStartsActive.Value);
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
@ -766,12 +767,20 @@ namespace osu.Game.Overlays.Mods
|
||||
return false;
|
||||
|
||||
// TODO: should probably eventually support typical platform search shortcuts (`Ctrl-F`, `/`)
|
||||
SearchTextBox.HoldFocus = !SearchTextBox.HoldFocus;
|
||||
if (SearchTextBox.HoldFocus)
|
||||
SearchTextBox.TakeFocus();
|
||||
setTextBoxFocus(!textBoxShouldFocus);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void setTextBoxFocus(bool keepFocus)
|
||||
{
|
||||
textBoxShouldFocus = keepFocus;
|
||||
|
||||
if (textBoxShouldFocus)
|
||||
SearchTextBox.TakeFocus();
|
||||
else
|
||||
SearchTextBox.KillFocus();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Sample playback control
|
||||
|
Loading…
Reference in New Issue
Block a user