|
|
|
@ -5088,15 +5088,6 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us |
|
|
|
|
window->DC.ItemFlags &= ~ImGuiItemFlags_AllowNavDefaultFocus; |
|
|
|
|
window->DC.NavLayerCurrent++; |
|
|
|
|
|
|
|
|
|
// Close button
|
|
|
|
|
if (p_open != NULL) |
|
|
|
|
{ |
|
|
|
|
const float PAD = 2.0f; |
|
|
|
|
const float rad = (window->TitleBarHeight() - PAD*2.0f) * 0.5f; |
|
|
|
|
if (CloseButton(window->GetID("#CLOSE"), window->Rect().GetTR() + ImVec2(-PAD - rad, PAD + rad), rad)) |
|
|
|
|
*p_open = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Collapse button
|
|
|
|
|
const ImVec2 text_size = CalcTextSize(name, NULL, true); |
|
|
|
|
if (!(flags & ImGuiWindowFlags_NoCollapse)) |
|
|
|
@ -5110,6 +5101,15 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us |
|
|
|
|
RenderCollapseTriangle(window->Pos + style.FramePadding, !window->Collapsed, 1.0f, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Close button
|
|
|
|
|
if (p_open != NULL) |
|
|
|
|
{ |
|
|
|
|
const float PAD = 2.0f; |
|
|
|
|
const float rad = (window->TitleBarHeight() - PAD*2.0f) * 0.5f; |
|
|
|
|
if (CloseButton(window->GetID("#CLOSE"), window->Rect().GetTR() + ImVec2(-PAD - rad, PAD + rad), rad)) |
|
|
|
|
*p_open = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
window->DC.NavLayerCurrent--; |
|
|
|
|
window->DC.ItemFlags = backup_item_options; |
|
|
|
|
|
|
|
|
|