ocornut / imgui

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

Question: Auto tile panels #7721

Open prowindowsuser opened 3 months ago

prowindowsuser commented 3 months ago

Version/Branch of Dear ImGui:

v1.90.8 WIP docking branch

Back-ends:

imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp

Compiler, OS:

Windows10 + msvc

Full config/build information:

No response

Details:

All panels, bars are just BeginChild/EndChild in some other file, top and right "bars" is ImVec2(0,70) and ImVec2(250,0) because they never move&resize. I cant find a way to tile "panels" (theyre beginchild,endchild with ImVec2(0,0) somewhere else) in a way like this. I just want to be directed into right way to achive this tiling with beginchild/endchild style "panels". they are basic panels just some text and buttons inside. Thanks

Screenshots/Video:

im_sorry_for_this_issue

Minimal, Complete and Verifiable Example code:

// Simlified Example Code

// but actually there should be list of panels that should look like in the screenshot
Panel Panel1;
Panel Panel2;

ImGui::Begin("Main", NULL, WINDOW_FLAGS);
TopBar::Render(); //beginchild, endchild with text&buttons
LeftBar::Render();//beginchild, endchild with text&buttons

ImGui::Columns(2, "panels", false);
ImGui::SetColumnWidth(0 ,window_width/2);
ImGui::SetColumnWidth(1, window_width/2);

Panel1::Render();
ImGui::NextColumn();

Panel2::Render();
ImGui::Columns(1);
ImGui::End();
GamingMinds-DanielC commented 3 months ago

To push you in the right direction:

With that, you can manage the available space however you want.