Fix UI scaling issues

pull/3/head v4.1
Liza 2024-03-27 18:29:49 +01:00
parent 76d00fb2dc
commit 9a0dfafb85
Signed by: liza
GPG Key ID: 7199F8D727D55F67
3 changed files with 18 additions and 10 deletions

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<Version>4.0</Version> <Version>4.1</Version>
<LangVersion>12</LangVersion> <LangVersion>12</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

View File

@ -89,9 +89,9 @@ internal sealed class ConfigWindow : LWindow
IDalamudTextureWrap? icon = _iconCache.GetIcon(item.IconId); IDalamudTextureWrap? icon = _iconCache.GetIcon(item.IconId);
if (icon != null) if (icon != null)
{ {
ImGui.Image(icon.ImGuiHandle, new Vector2(23, 23)); ImGui.Image(icon.ImGuiHandle, new Vector2(ImGui.GetFrameHeight()));
ImGui.SameLine(); ImGui.SameLine();
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + 3); ImGui.SetCursorPosY(ImGui.GetCursorPosY() + ImGui.GetStyle().FramePadding.X);
} }
ImGui.Selectable($"{item.Name}{(item.Limited ? $" {SeIconChar.Hyadelyn.ToIconString()}" : "")}"); ImGui.Selectable($"{item.Name}{(item.Limited ? $" {SeIconChar.Hyadelyn.ToIconString()}" : "")}");
@ -166,9 +166,9 @@ internal sealed class ConfigWindow : LWindow
IDalamudTextureWrap? icon = _iconCache.GetIcon(item.IconId); IDalamudTextureWrap? icon = _iconCache.GetIcon(item.IconId);
if (icon != null) if (icon != null)
{ {
ImGui.Image(icon.ImGuiHandle, new Vector2(23, 23)); ImGui.Image(icon.ImGuiHandle, new Vector2(ImGui.GetFrameHeight()));
ImGui.SameLine(); ImGui.SameLine();
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + 3); ImGui.SetCursorPosY(ImGui.GetCursorPosY() + ImGui.GetStyle().FramePadding.X);
} }
bool addThis = bool addThis =
@ -329,7 +329,8 @@ internal sealed class ConfigWindow : LWindow
if (reserveDifferentSealCountAtMaxRank) if (reserveDifferentSealCountAtMaxRank)
{ {
ImGui.Indent(); float indentSize = ImGui.GetFrameHeight() + ImGui.GetStyle().ItemInnerSpacing.X;
ImGui.Indent(indentSize);
ImGui.SetNextItemWidth(ImGuiHelpers.GlobalScale * 100); ImGui.SetNextItemWidth(ImGuiHelpers.GlobalScale * 100);
int reservedSealCountAtMaxRank = _configuration.ReservedSealCountAtMaxRank; int reservedSealCountAtMaxRank = _configuration.ReservedSealCountAtMaxRank;
if (ImGui.InputInt("Minimum seals to keep at max rank", ref reservedSealCountAtMaxRank)) if (ImGui.InputInt("Minimum seals to keep at max rank", ref reservedSealCountAtMaxRank))
@ -339,7 +340,7 @@ internal sealed class ConfigWindow : LWindow
Save(); Save();
} }
ImGui.Unindent(); ImGui.Unindent(indentSize);
} }
ImGui.EndDisabled(); ImGui.EndDisabled();

View File

@ -49,6 +49,7 @@ internal sealed class TurnInWindow : LWindow
private readonly ICondition _condition; private readonly ICondition _condition;
private readonly IClientState _clientState; private readonly IClientState _clientState;
private readonly GcRewardsCache _gcRewardsCache; private readonly GcRewardsCache _gcRewardsCache;
private readonly ConfigWindow _configWindow;
private readonly IconCache _iconCache; private readonly IconCache _iconCache;
private bool _state; private bool _state;
@ -64,6 +65,7 @@ internal sealed class TurnInWindow : LWindow
_condition = condition; _condition = condition;
_clientState = clientState; _clientState = clientState;
_gcRewardsCache = gcRewardsCache; _gcRewardsCache = gcRewardsCache;
_configWindow = configWindow;
_iconCache = iconCache; _iconCache = iconCache;
Position = new Vector2(100, 100); Position = new Vector2(100, 100);
@ -200,7 +202,8 @@ internal sealed class TurnInWindow : LWindow
State = state; State = state;
} }
ImGui.Indent(27); float indentSize = ImGui.GetFrameHeight() + ImGui.GetStyle().ItemInnerSpacing.X;
ImGui.Indent(indentSize);
if (!string.IsNullOrEmpty(Error)) if (!string.IsNullOrEmpty(Error))
{ {
ImGui.TextColored(ImGuiColors.DalamudRed, Error); ImGui.TextColored(ImGuiColors.DalamudRed, Error);
@ -240,7 +243,7 @@ internal sealed class TurnInWindow : LWindow
} }
} }
ImGui.Unindent(27); ImGui.Unindent(indentSize);
ImGui.Separator(); ImGui.Separator();
ImGui.BeginDisabled(state); ImGui.BeginDisabled(state);
@ -352,7 +355,7 @@ internal sealed class TurnInWindow : LWindow
IDalamudTextureWrap? icon = _iconCache.GetIcon(comboItem.Item.IconId); IDalamudTextureWrap? icon = _iconCache.GetIcon(comboItem.Item.IconId);
if (icon != null) if (icon != null)
{ {
ImGui.Image(icon.ImGuiHandle, new Vector2(23, 23)); ImGui.Image(icon.ImGuiHandle, new Vector2(ImGui.GetFrameHeight()));
ImGui.SameLine(0, 3); ImGui.SameLine(0, 3);
} }
@ -475,6 +478,10 @@ internal sealed class TurnInWindow : LWindow
ImGui.EndPopup(); ImGui.EndPopup();
} }
ImGui.SameLine();
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Cog, "Configure available Items"))
_configWindow.IsOpen = true;
} }
} }