From e1de4908f6af2743f40895b09e43dfd11f184006 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 26 Mar 2015 19:18:06 +0000 Subject: [PATCH] Removed bool return value from BegniPopup() at the moment, it is meaningless. Tidying up. --- imgui.cpp | 13 +++++++------ imgui.h | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index cac1d6d1..df7fae6a 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -2742,8 +2742,8 @@ int ImGui::GetFrameCount() void ImGui::BeginTooltip() { ImGuiState& g = *GImGui; - ImGuiWindowFlags window_flags = ImGuiWindowFlags_Tooltip|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_AlwaysAutoResize; - ImGui::Begin("##Tooltip", NULL, ImVec2(0,0), g.Style.Colors[ImGuiCol_TooltipBg].w, window_flags); + ImGuiWindowFlags flags = ImGuiWindowFlags_Tooltip|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_AlwaysAutoResize; + ImGui::Begin("##Tooltip", NULL, ImVec2(0,0), g.Style.Colors[ImGuiCol_TooltipBg].w, flags); } void ImGui::EndTooltip() @@ -2752,12 +2752,13 @@ void ImGui::EndTooltip() ImGui::End(); } -bool ImGui::BeginPopup(bool* p_opened) +void ImGui::BeginPopup(bool* p_opened) { IM_ASSERT(p_opened != NULL); // Must provide a bool at the moment + ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f); - bool ret = ImGui::Begin("##Popup", p_opened, ImGuiWindowFlags_Popup|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_AlwaysAutoResize); - return ret; + ImGuiWindowFlags flags = ImGuiWindowFlags_Popup|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_AlwaysAutoResize; + ImGui::Begin("##Popup", p_opened, flags); } void ImGui::EndPopup() @@ -9469,7 +9470,7 @@ void ImGui::ShowTestWindow(bool* opened) ImGui::TreePop(); } - if (ImGui::TreeNode("Popup Menu")) + if (ImGui::TreeNode("Popup")) { static bool popup_open = false; static int selected_fish = -1; diff --git a/imgui.h b/imgui.h index 74eb1333..09defd79 100644 --- a/imgui.h +++ b/imgui.h @@ -225,7 +225,7 @@ namespace ImGui IMGUI_API void EndTooltip(); // Popup - IMGUI_API bool BeginPopup(bool* p_opened); + IMGUI_API void BeginPopup(bool* p_opened); IMGUI_API void EndPopup(); // Layout