ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
60.9k stars 10.29k forks source link

How to tell dockspace to fill entire available space when trying to dock first window? #4334

Open BreyerW opened 3 years ago

BreyerW commented 3 years ago

NoSplit dock flag is extremely close, the problem is, it persist after first window was docked which is NOT what i want. And ideally i would like to still have 5 docking spots instead of only central being rendered. The idea is that i dont want accidental empty spaces between docked windows. Just checking on empty dockspace would solve most cases i think

And i dont want to rely on imgui_internal since i rely on ImGUI.NET which is c# binding and this in turn rely on cimgui and since imgui_internal is still considered, well, internal, not many binding authors bothered to bind against that.

ocornut commented 3 years ago

I don’t understand your question, please clarify the problem with more concrete examples.

BreyerW commented 3 years ago

This is empty dockspace (+menu bar but not relevant here)

devenv_0dd1GsJQHZ

And when i try to dock first window to this empty space i get this:

devenv_WbELGgB3JW

right part of dockspace didnt get covered by docked window what i would like to avoid. Or in other words when docking to empty dockspace i would like for docked element to eat up all space afforded by dockspace. (no matter where i dock - left, bottom, central - docked element should always eat up all space IF dockspace is empty)

EDIT:

this is what i want to achieve when docking anywhere on empty dockspace:

firefox_f0iZ7S0KQ8

(achieved this by docking to central node but i would like to tell dockspace that all nodes should behave like central node IF dockspace is fully empty)

ocornut commented 3 years ago

If you dock in the central space it'll fill the node... Why would you bother preventing users from having more options?

Anyway it is not possible using the public API. The bindings should automatically expose cimgui_internal for (we are also rewriting cimgui to make that more attainable).

BreyerW commented 3 years ago

i want the window itself still be splittable, just on empty dockspace prevent splitting in order to feel more organized. Eg after first dock i would like to still be able to do this:

devenv_VaUrURBLAq

the idea is to prevent any empty space to "leak out" as long as there is one docked element but still allow fully featured splitting afterward. Just UI design and a bit of UX

ocornut commented 3 years ago

As per #3168 I guess we'd need to implement ImGuiDockNodeFlags_NoCentralNode and revise some of the properties (an empty dockspace will still need to display an empty node but it won't be a central node).

BreyerW commented 2 years ago

@ocornut i was recently thinking if it would be possible to make stopgap solution that would simply move docked element to central node if no nodes are filled with a flag named maybe like ImGuiDockNodeFlags_MoveToCentralNodeWhenDockspaceEmpty (although i see possible gotcha with this particular solution when removing docked elements instead of adding - i would like to prevent situation where removing second to last element causes background to 'leak' by automatically moving last element to central node on remove if possible). Im asking this bc u said in linked issues that u plan to make a complete overhaul of docking properties but that might not materialize for 1+ years, at least thats what ur messages sounded to me since u mentioned it would be difficult undertaking with no guarantee of success.

nikitablack commented 4 months ago

Hello. What is the status of this issue? I can see the ImGuiDockNodeFlags_NoCentralNode flag in imgui.h but it's commented out. Does that mean that it's not possible to get rid of empty spaces?