ocornut / imgui

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

How to assign different window paddings in one window? #7446

Open mintygingy opened 6 months ago

mintygingy commented 6 months ago

Version/Branch of Dear ImGui:

Version 1.90, Branch: Master (master/docking/etc.)

Back-ends:

imgui_impl_DX11.cpp + imgui_impl_Win31.cpp

Compiler, OS:

Windows 10 + MSVC 143

Full config/build information:

No response

Details:

My Issue/Question:

image I have a Window with couple child objects, Child1 and Child2. Child1 is some kind of vertical menu, containing different tabs, when Child2 is a content of current tab. How can i make Child1 stay without any paddings, and Child2 - with? Var handling this stuff is "WindowPadding", but catch is that i can't use multiple WindowPaddings in one window. image

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

No response

ocornut commented 6 months ago

WindowPadding is mostly a way to set default cursor X position and clipping boundaries, but you can use e.g. Indent() to shift the current X position, and PushClipRect() if you need to adjust clipping boundaries. You may also simply set SetCursorScreenPos() or SetNextWindowPos() before calling BeginChild() to position it.