From 5a3ae5154c0e415f00688516cede26888b1f25ff Mon Sep 17 00:00:00 2001 From: xPumaa <35280763+xPumaa@users.noreply.github.com> Date: Fri, 8 Jul 2022 20:44:09 +0200 Subject: [PATCH] Resized nick field --- MareSynchronos/UI/CompactUI.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MareSynchronos/UI/CompactUI.cs b/MareSynchronos/UI/CompactUI.cs index 274d09c..8212dcc 100644 --- a/MareSynchronos/UI/CompactUI.cs +++ b/MareSynchronos/UI/CompactUI.cs @@ -145,6 +145,7 @@ namespace MareSynchronos.UI var trashButtonSize = GetIconButtonSize(FontAwesomeIcon.Trash); var textSize = ImGui.CalcTextSize(entry.OtherUID); var originalY = ImGui.GetCursorPosY(); + var buttonSizes = buttonSize.Y + trashButtonSize.Y; var textPos = originalY + buttonSize.Y / 2 - textSize.Y / 2; ImGui.SetCursorPosY(textPos); @@ -226,8 +227,8 @@ namespace MareSynchronos.UI { ImGui.SetCursorPosY(originalY); - ImGui.InputTextWithHint("", "Nick/Notes", ref _editCharComment, 255); - if (ImGui.GetIO().KeysDown[(int)ImGuiKey.Enter]) + ImGui.SetNextItemWidth(ImGui.GetWindowContentRegionWidth() - ImGui.GetCursorPosX() - buttonSizes - ImGui.GetStyle().ItemSpacing.X * 2); + if (ImGui.InputTextWithHint("", "Nick/Notes", ref _editCharComment, 255, ImGuiInputTextFlags.EnterReturnsTrue)) { _configuration.SetCurrentServerUidComment(entry.OtherUID, _editCharComment); _configuration.Save();