From a72be22d3b295250716408fa0d01976f44a6e7b3 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Fri, 26 Apr 2024 10:56:06 +0200 Subject: [PATCH] Make sure HS image does not displace the settings entirely. --- Penumbra/UI/ModsTab/ModPanelHeader.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Penumbra/UI/ModsTab/ModPanelHeader.cs b/Penumbra/UI/ModsTab/ModPanelHeader.cs index 05f47809..a8b393b1 100644 --- a/Penumbra/UI/ModsTab/ModPanelHeader.cs +++ b/Penumbra/UI/ModsTab/ModPanelHeader.cs @@ -18,6 +18,7 @@ public class ModPanelHeader : IDisposable private readonly IFontHandle _nameFont; private readonly CommunicatorService _communicator; + private float _lastPreSettingsHeight = 0; public ModPanelHeader(DalamudPluginInterface pi, CommunicatorService communicator) { @@ -32,6 +33,11 @@ public class ModPanelHeader : IDisposable /// public void Draw() { + var height = ImGui.GetContentRegionAvail().Y; + var maxHeight = 3 * height / 4; + using var child = _lastPreSettingsHeight > maxHeight && _communicator.PreSettingsTabBarDraw.HasSubscribers + ? ImRaii.Child("HeaderChild", new Vector2(ImGui.GetContentRegionAvail().X, maxHeight), false) + : null; using (ImRaii.Group()) { var offset = DrawModName(); @@ -40,6 +46,7 @@ public class ModPanelHeader : IDisposable } _communicator.PreSettingsTabBarDraw.Invoke(_mod.Identifier, ImGui.GetItemRectSize().X, _nameWidth); + _lastPreSettingsHeight = ImGui.GetCursorPosY(); } /// @@ -48,6 +55,7 @@ public class ModPanelHeader : IDisposable /// public void UpdateModData(Mod mod) { + _lastPreSettingsHeight = 0; _mod = mod; // Name var name = $" {mod.Name} ";