mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-15 13:14:17 +01:00
Make sure HS image does not displace the settings entirely.
This commit is contained in:
parent
06953c175d
commit
a72be22d3b
1 changed files with 8 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ public class ModPanelHeader : IDisposable
|
||||||
private readonly IFontHandle _nameFont;
|
private readonly IFontHandle _nameFont;
|
||||||
|
|
||||||
private readonly CommunicatorService _communicator;
|
private readonly CommunicatorService _communicator;
|
||||||
|
private float _lastPreSettingsHeight = 0;
|
||||||
|
|
||||||
public ModPanelHeader(DalamudPluginInterface pi, CommunicatorService communicator)
|
public ModPanelHeader(DalamudPluginInterface pi, CommunicatorService communicator)
|
||||||
{
|
{
|
||||||
|
|
@ -32,6 +33,11 @@ public class ModPanelHeader : IDisposable
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Draw()
|
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())
|
using (ImRaii.Group())
|
||||||
{
|
{
|
||||||
var offset = DrawModName();
|
var offset = DrawModName();
|
||||||
|
|
@ -40,6 +46,7 @@ public class ModPanelHeader : IDisposable
|
||||||
}
|
}
|
||||||
|
|
||||||
_communicator.PreSettingsTabBarDraw.Invoke(_mod.Identifier, ImGui.GetItemRectSize().X, _nameWidth);
|
_communicator.PreSettingsTabBarDraw.Invoke(_mod.Identifier, ImGui.GetItemRectSize().X, _nameWidth);
|
||||||
|
_lastPreSettingsHeight = ImGui.GetCursorPosY();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -48,6 +55,7 @@ public class ModPanelHeader : IDisposable
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void UpdateModData(Mod mod)
|
public void UpdateModData(Mod mod)
|
||||||
{
|
{
|
||||||
|
_lastPreSettingsHeight = 0;
|
||||||
_mod = mod;
|
_mod = mod;
|
||||||
// Name
|
// Name
|
||||||
var name = $" {mod.Name} ";
|
var name = $" {mod.Name} ";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue