Open PapaNaxos opened 6 months ago
I have made a bit more progress. I can now stop the the popup from closing when using the primary modal.
I had to add to the window flags enum in imgui.h
ImGuiWindowFlags_ModalSecondary = 1 << 30
And add the following lines to ImGui::ClosePopupsOverWindow
if (popup.Window->Flags & ImGuiWindowFlags_ModalSecondary)
continue;
which is directly after:
if (popup.Window->Flags & ImGuiWindowFlags_ChildWindow)
continue;
And call my help window including the new ImGuiWindowFlags_ModalSecondary
flag
This works, but has a few issues:
I don't like having to modify ImGui code, but did not see an alternative (especially having to use one of the ImGuiWindowFlags_ which is nearly full, so future updates may use up these flag spots).
Definitely open to suggestions on how to improve / fix the remaining issues. Thanks!
Another issue is that comboboxes will also cause the secondary help window to close.
Version/Branch of Dear ImGui:
Version 1.90, Branch:docking
Back-ends:
imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp
Compiler, OS:
rhel8 + GCC 8.5.0
Full config/build information:
Details:
My Issue/Question:
What I'm trying to achieve is having a second window/popup open while using a modal popup. The purpose of this secondary window/popup is to provide help information for the user while they use the UI provided by the modal window.
Ideally, the help window would have the following properties:
So approximately the structure of the UI would be something like:
I managed to achieve a subset of this functionality with the following code:
This achieves:
But fails to achieve:
The features marked with *()** are desirable, but not essential. However, I'd very much like for the help window to stay open when interacting with the primary modal UI.
Is there any way to achieve this with the normal API, or perhaps some small modifications/additions to the IMGUI source I can make?
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
No response