Fix button alignment when no drag/drop button is visible

This commit is contained in:
Liza 2024-07-19 19:23:03 +02:00
parent 89951227af
commit 254d16bd8c
Signed by: liza
GPG Key ID: 7199F8D727D55F67
2 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<Project Sdk="Dalamud.NET.Sdk/9.0.2">
<PropertyGroup>
<Version>5.2</Version>
<Version>5.3</Version>
<OutputPath>dist</OutputPath>
</PropertyGroup>

View File

@ -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)