CogWindow: Add an option to have no padding on windows (used by CogAbilityWindow_Abilities, Effects, Tags, ...)

This commit is contained in:
Arnaud Jamin
2023-11-05 00:32:25 -04:00
parent 860c9be349
commit c44171b113
10 changed files with 84 additions and 56 deletions
@@ -63,8 +63,18 @@ void FCogWindow::Render(float DeltaTime)
WindowFlags |= ImGuiWindowFlags_MenuBar;
}
if (bNoPadding)
{
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
}
if (ImGui::Begin(TCHAR_TO_ANSI(*WindowTitle), &bIsVisible, WindowFlags))
{
if (bNoPadding)
{
ImGui::PopStyleVar(1);
}
if (GetOwner()->GetShowHelp())
{
if (ImGui::IsItemHovered())
@@ -102,6 +112,13 @@ void FCogWindow::Render(float DeltaTime)
RenderContent();
ImGui::End();
}
else
{
if (bNoPadding)
{
ImGui::PopStyleVar(1);
}
}
PostRender();
}