mirror of
https://github.com/ppy/osu
synced 2025-02-07 22:01:59 +00: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 ShearedToggleButton? CustomisationButton { get; private set; }
|
||||||
protected SelectAllModsButton? SelectAllModsButton { get; set; }
|
protected SelectAllModsButton? SelectAllModsButton { get; set; }
|
||||||
|
|
||||||
|
private bool textBoxShouldFocus;
|
||||||
|
|
||||||
private Sample? columnAppearSample;
|
private Sample? columnAppearSample;
|
||||||
|
|
||||||
private WorkingBeatmap? beatmap;
|
private WorkingBeatmap? beatmap;
|
||||||
@ -510,9 +512,9 @@ namespace osu.Game.Overlays.Mods
|
|||||||
TopLevelContent.MoveToY(-modAreaHeight, transition_duration, Easing.InOutCubic);
|
TopLevelContent.MoveToY(-modAreaHeight, transition_duration, Easing.InOutCubic);
|
||||||
|
|
||||||
if (customisationVisible.Value)
|
if (customisationVisible.Value)
|
||||||
GetContainingInputManager().ChangeFocus(modSettingsArea);
|
SearchTextBox.KillFocus();
|
||||||
else
|
else
|
||||||
Scheduler.Add(() => GetContainingInputManager().ChangeFocus(null));
|
setTextBoxFocus(textBoxShouldFocus);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -626,8 +628,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
nonFilteredColumnCount += 1;
|
nonFilteredColumnCount += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (textSearchStartsActive.Value)
|
setTextBoxFocus(textSearchStartsActive.Value);
|
||||||
SearchTextBox.HoldFocus = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void PopOut()
|
protected override void PopOut()
|
||||||
@ -766,12 +767,20 @@ namespace osu.Game.Overlays.Mods
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// TODO: should probably eventually support typical platform search shortcuts (`Ctrl-F`, `/`)
|
// TODO: should probably eventually support typical platform search shortcuts (`Ctrl-F`, `/`)
|
||||||
SearchTextBox.HoldFocus = !SearchTextBox.HoldFocus;
|
setTextBoxFocus(!textBoxShouldFocus);
|
||||||
if (SearchTextBox.HoldFocus)
|
|
||||||
SearchTextBox.TakeFocus();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setTextBoxFocus(bool keepFocus)
|
||||||
|
{
|
||||||
|
textBoxShouldFocus = keepFocus;
|
||||||
|
|
||||||
|
if (textBoxShouldFocus)
|
||||||
|
SearchTextBox.TakeFocus();
|
||||||
|
else
|
||||||
|
SearchTextBox.KillFocus();
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Sample playback control
|
#region Sample playback control
|
||||||
|
Loading…
Reference in New Issue
Block a user