-
Notifications
You must be signed in to change notification settings - Fork 608
Description
Hello @thedmd,
Many thanks for your wonderful library!
During the development of Dear ImGui Bundle, I applied a series of patches to imgui-node-editor and imgui, to make their integration smoother. Since they require modifications on both imgui and imgui-node-editor, proposing a PR is not straightforward.
However, since they might be useful, I took the time to group them here in this issue, in the hope of being helpful.
Demo
Video demo:
Untitled13.mov
You can also test it live on this webasm demo
Handle node width in separators:
Thanks to this patch, ImGui::SeparatorText()
, ImGui::Separator()
, and ImGui::CollapsingHeader()
can use the actual node width. It was proposed here
Handle Popups:
@lukaasm proposed a patch here, which solves many issues with popups in the node editor (by automatically suspending the canvas, and placing popups correctly).
Example implementation for this patch:
- inside imgui-node-editor
- inside imgui
With this patch, ImGui::ColorEdit
, ImGui::Begin/EndCombo
will work correctly inside a node.
Warn users if using BeginChild / EndChild:
imgui-node-editor remains incompatible with ImGui::BeginChild()
and ImGui::EndChild()
.
Below is the list of ImGui widgets which are concerned (because they use BeginChild/EndChild):
- ImGui::InputTextMultiline()
- ImGui::BeginListbox() and ImGui::EndListbox()
- ImGui::BeginChild() and ImGui::EndChild()
We can warn the developer whenever they use these functions inside a node:
- patch inside imgui
- patch inside imgui-node-editor
Handle InputTextMultiline
By default InputTextMultiline
uses a child window, which is not compatible with the node editor.
An additional patch adapts its behavior, by showing a preview within a single line text input,
followed by a "..." button which triggers a popup with the full text edition.
To apply this, two patches are required: