mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-14 00:34:18 +00:00
Added BeginPopupContextVoid() helper for completeness (#126)
This commit is contained in:
parent
235cca4f97
commit
dcc7df2b21
2 changed files with 11 additions and 2 deletions
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue