mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-02 12:48:14 +00:00
CogWindow: Add an option to have no padding on windows (used by CogAbilityWindow_Abilities, Effects, Tags, ...)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user