BeginPopupContextWindow() rearranged and clarified parameters (#126)

This commit is contained in:
ocornut
2015-05-27 23:07:24 +01:00
parent b0a9bbf6f6
commit 1cb6a294b0
2 changed files with 4 additions and 3 deletions

View File

@ -3180,10 +3180,11 @@ bool ImGui::BeginPopupContextItem(const char* str_id, int button)
return ImGui::BeginPopup(str_id);
}
bool ImGui::BeginPopupContextWindow(const char* str_id, bool void_only, 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 (ImGui::IsMouseHoveringWindow() && ImGui::IsMouseClicked(button))
if (!void_only || !ImGui::IsAnyItemHovered())
if (!in_empty_space_only || !ImGui::IsAnyItemHovered())
ImGui::OpenPopup(str_id);
return ImGui::BeginPopup(str_id);
}