Open Sioyth opened 11 months ago
I hadn't considered this case so far.
In DockNodeUpdate()
if you replace this code:
if (host_window && node->Windows.Size > 0)
{
DockNodeUpdateTabBar(node, host_window);
}
by
if (host_window && node->IsLeafNode())
{
DockNodeUpdateTabBar(node, host_window);
}
At first glance it would seem to work. but I don't know what the side effects may be and it would need more thought and design work.
As a rule of thumb the way to detect side effects is to run the imgui_test_suite.
docking_split_payload
seems to be the only failing tests but I would guess this would requires more methodical work to validate.
As an alternative you could also decide to submit a dummy "welcome screen" type of window as a workaround.
Hey, thank you for the quick reply.
Yeah, it is a bit of an odd case. I will change it as you suggested and run some tests, even though I might go with what you suggested which was the workaround I had in mind just to have some landing page which honestly also looks better!
But I wonder if this could ever be a feature of the nodes where a flag could be pushed for it to always be visible?
But I wonder if this could ever be a feature of the nodes where a flag could be pushed for it to always be visible?
We can consider it indeed. If aforementioned change works it could be exposed as a flag. Being a imgui_internal.h flag gives you a little more flexibility in committing this. But first the failing test needs to be investigated.
I think that would be a good idea for this edge cases, I will do some investigating and experimenting see if it breaks anything else aswell!
Version/Branch of Dear ImGui:
Version: v1.89.8 Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp Operating System: Windows 11
My Issue/Question:
In order to create a tab manager, I wanted to incorporate a "+" button onto a docking bar. To achieve this, I've been utilizing the ImGui::DockNodeBeginAmendTabBar(dockNode) function. However I append a tab item button to an empty docked bar, therefore the button doesn't appear until a window is docked into it. For a clearer understanding, you can refer to the video provided below. (Probably a bit easier to understand)
I'm guessing that's the wanted and default behaviour to not show anything on it unless a window is there, is there any way to make it visible?
Thank you!
Screenshots/Video
Set up dock space (SetDefaultStyle function)
Draw Dockspace