mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-26 13:37:00 +00:00
Internals: Removed misleading GetWindowParent() function. + renaming to clear confusing.
This commit is contained in:
parent
4a555d35f0
commit
f42d7b89e2
15
imgui.cpp
15
imgui.cpp
@ -1910,13 +1910,6 @@ static void SetCurrentWindow(ImGuiWindow* window)
|
||||
g.FontSize = window->CalcFontSize();
|
||||
}
|
||||
|
||||
ImGuiWindow* ImGui::GetParentWindow()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
IM_ASSERT(g.CurrentWindowStack.Size >= 2);
|
||||
return g.CurrentWindowStack[(unsigned int)g.CurrentWindowStack.Size - 2];
|
||||
}
|
||||
|
||||
void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
@ -3686,9 +3679,9 @@ void ImGui::EndTooltip()
|
||||
void ImGui::OpenPopupEx(ImGuiID id, bool reopen_existing)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
ImGuiWindow* parent_window = g.CurrentWindow;
|
||||
int current_stack_size = g.CurrentPopupStack.Size;
|
||||
ImGuiPopupRef popup_ref = ImGuiPopupRef(id, window, window->GetID("##Menus"), g.IO.MousePos); // Tagged as new ref because constructor sets Window to NULL (we are passing the ParentWindow info here)
|
||||
ImGuiPopupRef popup_ref = ImGuiPopupRef(id, parent_window, parent_window->GetID("##Menus"), g.IO.MousePos); // Tagged as new ref because constructor sets Window to NULL.
|
||||
if (g.OpenPopupStack.Size < current_stack_size + 1)
|
||||
g.OpenPopupStack.push_back(popup_ref);
|
||||
else if (reopen_existing || g.OpenPopupStack[current_stack_size].PopupId != id)
|
||||
@ -3699,7 +3692,7 @@ void ImGui::OpenPopupEx(ImGuiID id, bool reopen_existing)
|
||||
// When reopening a popup we first refocus its parent, otherwise if its parent is itself a popup it would get closed by CloseInactivePopups().
|
||||
// This is equivalent to what ClosePopupToLevel() does.
|
||||
if (g.OpenPopupStack[current_stack_size].PopupId == id)
|
||||
FocusWindow(window);
|
||||
FocusWindow(parent_window);
|
||||
}
|
||||
}
|
||||
|
||||
@ -9426,7 +9419,7 @@ bool ImGui::ListBoxHeader(const char* label, int items_count, int height_in_item
|
||||
|
||||
void ImGui::ListBoxFooter()
|
||||
{
|
||||
ImGuiWindow* parent_window = GetParentWindow();
|
||||
ImGuiWindow* parent_window = GetCurrentWindow()->ParentWindow;
|
||||
const ImRect bb = parent_window->DC.LastItemRect;
|
||||
const ImGuiStyle& style = GetStyle();
|
||||
|
||||
|
@ -799,7 +799,6 @@ namespace ImGui
|
||||
// - You are calling ImGui functions after ImGui::Render() and before the next ImGui::NewFrame(), which is also illegal.
|
||||
inline ImGuiWindow* GetCurrentWindowRead() { ImGuiContext& g = *GImGui; return g.CurrentWindow; }
|
||||
inline ImGuiWindow* GetCurrentWindow() { ImGuiContext& g = *GImGui; g.CurrentWindow->WriteAccessed = true; return g.CurrentWindow; }
|
||||
IMGUI_API ImGuiWindow* GetParentWindow();
|
||||
IMGUI_API ImGuiWindow* FindWindowByName(const char* name);
|
||||
IMGUI_API void FocusWindow(ImGuiWindow* window);
|
||||
IMGUI_API void BringWindowToFront(ImGuiWindow* window);
|
||||
|
Loading…
Reference in New Issue
Block a user