Entering text into lobby chat box does not release focus.

This commit is contained in:
Pieter-Jan Briers
2019-05-08 16:49:59 +02:00
parent 29304a7714
commit 0ccefebc52
2 changed files with 8 additions and 2 deletions

View File

@@ -38,6 +38,8 @@ namespace Content.Client.Chat
/// </summary>
public string DefaultChatFormat { get; set; }
public bool ReleaseFocusOnEnter { get; set; } = true;
protected override void Initialize()
{
base.Initialize();
@@ -151,7 +153,11 @@ namespace Content.Client.Chat
_inputIndex = -1;
Input.Clear();
Input.ReleaseKeyboardFocus();
if (ReleaseFocusOnEnter)
{
Input.ReleaseKeyboardFocus();
}
}
}
}

View File

@@ -28,7 +28,7 @@ namespace Content.Client.UserInterface
base.Initialize();
var chatContainer = GetChild("Panel/VBoxContainer/HBoxContainer/LeftVBox");
Chat = new ChatBox();
Chat = new ChatBox {ReleaseFocusOnEnter = false};
chatContainer.AddChild(Chat);
Chat.SizeFlagsVertical = SizeFlags.FillExpand;
}