-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
Constraint of only min or max window size #1139
Comments
Hello, |
Has anyone found a solution for setting the max window size? I saw that ImGui has a min var(ImGuiStyleVar_WindowMinSize) but I didn't see a max, please enlighten me. |
Nevermind, I found a function after a bit of documentation spelunking. My solution was using SetNextWindowSizeConstraints. |
I have now answered for #3186, but essentially the correct way to do what you requested is:
|
I've got a tweak to
ApplySizeFullWithConstraint
that allows you to constrain only the minimum, or only the maximum size of a window. This is useful where I want to useImGuiWindowFlags_AlwaysAutoResize
, but with a minimum so that the title bar text is visible, and the window is at least a reasonable size. Eg:SetNextWindowSizeConstraints(ImVec2(100.0f, -1.0f), ImVec2(-1.0f, -1.0f));
Is there a better way I could do this?
The text was updated successfully, but these errors were encountered: