mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-13 16:29:54 +02:00
Added BeginPopupContextVoid() helper for completeness (#126)
This commit is contained in:
10
imgui.cpp
10
imgui.cpp
@ -3185,13 +3185,21 @@ bool ImGui::BeginPopupContextItem(const char* str_id, int button)
|
||||
|
||||
bool ImGui::BeginPopupContextWindow(bool in_empty_space_only, const char* str_id, int button)
|
||||
{
|
||||
if (str_id == NULL) str_id = "window_context_menu";
|
||||
if (!str_id) str_id = "window_context_menu";
|
||||
if (ImGui::IsMouseHoveringWindow() && ImGui::IsMouseClicked(button))
|
||||
if (!in_empty_space_only || !ImGui::IsAnyItemHovered())
|
||||
ImGui::OpenPopup(str_id);
|
||||
return ImGui::BeginPopup(str_id);
|
||||
}
|
||||
|
||||
bool ImGui::BeginPopupContextVoid(const char* str_id, int button)
|
||||
{
|
||||
if (!str_id) str_id = "void_context_menu";
|
||||
if (!ImGui::IsMouseHoveringAnyWindow() && ImGui::IsMouseClicked(button))
|
||||
ImGui::OpenPopup(str_id);
|
||||
return ImGui::BeginPopup(str_id);
|
||||
}
|
||||
|
||||
bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags)
|
||||
{
|
||||
ImGuiState& g = *GImGui;
|
||||
|
Reference in New Issue
Block a user