From 0ca7926b94f8cd49ae3899109a2102032b9a6b62 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 3 May 2015 13:04:43 +0100 Subject: [PATCH] Popup auto-border doesn't spread to its childs #197 --- imgui.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index e951d611..c7f14579 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -2874,12 +2874,16 @@ void ImGui::EndTooltip() void ImGui::BeginPopup(bool* p_opened) { + ImGuiWindow* window = GetCurrentWindow(); IM_ASSERT(p_opened != NULL); // Must provide a bool at the moment ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f); ImGuiWindowFlags flags = ImGuiWindowFlags_Popup|ImGuiWindowFlags_ShowBorders|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_AlwaysAutoResize; float alpha = 1.0f; ImGui::Begin("##Popup", p_opened, ImVec2(0.0f, 0.0f), alpha, flags); + + if (!(window->Flags & ImGuiWindowFlags_ShowBorders)) + GetCurrentWindow()->Flags &= ~ImGuiWindowFlags_ShowBorders; } void ImGui::EndPopup() @@ -2922,7 +2926,7 @@ bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, bool border, bool ret = ImGui::Begin(title, NULL, size, alpha, flags); if (!(window->Flags & ImGuiWindowFlags_ShowBorders)) - g.CurrentWindow->Flags &= ~ImGuiWindowFlags_ShowBorders; + GetCurrentWindow()->Flags &= ~ImGuiWindowFlags_ShowBorders; return ret; }