mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 05:32:54 +08:00
Merge pull request #19543 from peppy/dont-clear-chat-overlay
Avoid clearing chat overlay textbox when pressing "back" key binding
This commit is contained in:
commit
227906e30e
@ -21,6 +21,11 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
private bool allowImmediateFocus => host?.OnScreenKeyboardOverlapsGameWindow != true;
|
private bool allowImmediateFocus => host?.OnScreenKeyboardOverlapsGameWindow != true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the content of the text box should be cleared on the first "back" key press.
|
||||||
|
/// </summary>
|
||||||
|
protected virtual bool ClearTextOnBackKey => true;
|
||||||
|
|
||||||
public void TakeFocus()
|
public void TakeFocus()
|
||||||
{
|
{
|
||||||
if (!allowImmediateFocus)
|
if (!allowImmediateFocus)
|
||||||
@ -78,7 +83,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
if (!HasFocus) return false;
|
if (!HasFocus) return false;
|
||||||
|
|
||||||
if (e.Action == GlobalAction.Back)
|
if (ClearTextOnBackKey && e.Action == GlobalAction.Back)
|
||||||
{
|
{
|
||||||
if (Text.Length > 0)
|
if (Text.Length > 0)
|
||||||
{
|
{
|
||||||
|
@ -13,6 +13,8 @@ namespace osu.Game.Overlays.Chat
|
|||||||
|
|
||||||
public override bool HandleLeftRightArrows => !ShowSearch.Value;
|
public override bool HandleLeftRightArrows => !ShowSearch.Value;
|
||||||
|
|
||||||
|
protected override bool ClearTextOnBackKey => false;
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
Loading…
Reference in New Issue
Block a user