Popups: Fixed a bug introduced in 1a35766356 which made the BeginPopupContextXXX functions create popups without border. (nb: all that border mess is going away in styling clean up)

This commit is contained in:
omar 2017-10-20 13:21:42 +02:00
parent 5f7299e15a
commit 853018dd4d

View File

@ -3750,7 +3750,7 @@ bool ImGui::BeginPopupContextItem(const char* str_id, int mouse_button)
IM_ASSERT(id != 0); // However, you cannot pass a NULL str_id if the last item has no identifier (e.g. a Text() item)
if (IsItemHovered() && IsMouseClicked(mouse_button))
OpenPopupEx(id, false);
return BeginPopupEx(id, 0);
return BeginPopupEx(id, ImGuiWindowFlags_ShowBorders | ImGuiWindowFlags_AlwaysAutoResize);
}
bool ImGui::BeginPopupContextWindow(const char* str_id, int mouse_button, bool also_over_items)
@ -3761,7 +3761,7 @@ bool ImGui::BeginPopupContextWindow(const char* str_id, int mouse_button, bool a
if (IsWindowRectHovered() && IsMouseClicked(mouse_button))
if (also_over_items || !IsAnyItemHovered())
OpenPopupEx(id, true);
return BeginPopupEx(id, 0);
return BeginPopupEx(id, ImGuiWindowFlags_ShowBorders | ImGuiWindowFlags_AlwaysAutoResize);
}
bool ImGui::BeginPopupContextVoid(const char* str_id, int mouse_button)
@ -3771,7 +3771,7 @@ bool ImGui::BeginPopupContextVoid(const char* str_id, int mouse_button)
ImGuiID id = GImGui->CurrentWindow->GetID(str_id);
if (!IsAnyWindowHovered() && IsMouseClicked(mouse_button))
OpenPopupEx(id, true);
return BeginPopupEx(id, 0);
return BeginPopupEx(id, ImGuiWindowFlags_ShowBorders | ImGuiWindowFlags_AlwaysAutoResize);
}
static bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags)