From c30abb79abdb21a90c8d6221b238a61ea3a1cb3c Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Fri, 19 Jul 2024 19:23:03 +0200 Subject: [PATCH] Fix button alignment when no drag/drop button is visible --- ARControl/ARControl.csproj | 2 +- ARControl/Windows/ConfigWindow.cs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ARControl/ARControl.csproj b/ARControl/ARControl.csproj index 8bb181a..8ce2297 100644 --- a/ARControl/ARControl.csproj +++ b/ARControl/ARControl.csproj @@ -1,6 +1,6 @@ - 5.2 + 5.3 dist diff --git a/ARControl/Windows/ConfigWindow.cs b/ARControl/Windows/ConfigWindow.cs index 855d685..5ed7594 100644 --- a/ARControl/Windows/ConfigWindow.cs +++ b/ARControl/Windows/ConfigWindow.cs @@ -153,7 +153,11 @@ internal sealed class ConfigWindow : LWindow } else { - ImGui.SameLine(0, 58); + ImGui.PushFont(UiBuilder.IconFont); + ImGui.SameLine(0, + ImGui.CalcTextSize(FontAwesomeIcon.ArrowsUpDown.ToIconString()).X + + ImGui.GetStyle().FramePadding.X * 2 + ImGui.GetStyle().ItemSpacing.X * 2); + ImGui.PopFont(); } if (ImGuiComponents.IconButton($"##Remove{i}", FontAwesomeIcon.Times)) @@ -202,7 +206,8 @@ internal sealed class ConfigWindow : LWindow var (topLeft, bottomRight) = itemPositions[oldIndex]; topLeft += new Vector2(MainIndentSize, 0); - ImGui.GetWindowDrawList().AddRect(topLeft, bottomRight, ImGui.GetColorU32(ImGuiColors.DalamudGrey), 3f, ImDrawFlags.RoundCornersAll); + ImGui.GetWindowDrawList().AddRect(topLeft, bottomRight, ImGui.GetColorU32(ImGuiColors.DalamudGrey), 3f, + ImDrawFlags.RoundCornersAll); int newIndex = itemPositions.IndexOf(x => ImGui.IsMouseHoveringRect(x.TopLeft, x.BottomRight, true)); if (newIndex >= 0 && oldIndex != newIndex)