Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mintygingy opened this issue Mar 27, 2024 · 1 comment
Open

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

mintygingy opened this issue Mar 27, 2024 · 1 comment
Labels

Comments

@mintygingy
Copy link

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 ocornut added the layout label Mar 28, 2024
@ocornut
Copy link
Owner

ocornut commented Mar 31, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants