From 0ccefebc520c1516b9ffcb3c6175ff0ab3ee5941 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Wed, 8 May 2019 16:49:59 +0200 Subject: [PATCH] Entering text into lobby chat box does not release focus. --- Content.Client/Chat/ChatBox.cs | 8 +++++++- Content.Client/UserInterface/LobbyGui.cs | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Content.Client/Chat/ChatBox.cs b/Content.Client/Chat/ChatBox.cs index f9f9b46152..2060c1e4e9 100644 --- a/Content.Client/Chat/ChatBox.cs +++ b/Content.Client/Chat/ChatBox.cs @@ -38,6 +38,8 @@ namespace Content.Client.Chat /// 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(); + } } } } diff --git a/Content.Client/UserInterface/LobbyGui.cs b/Content.Client/UserInterface/LobbyGui.cs index 0ff209bba1..64f6e65402 100644 --- a/Content.Client/UserInterface/LobbyGui.cs +++ b/Content.Client/UserInterface/LobbyGui.cs @@ -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; }