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

ImGuiWindowFlags_AlwaysAutoResize + Columns #1363

Closed
john-chapman opened this issue Oct 10, 2017 · 6 comments
Closed

ImGuiWindowFlags_AlwaysAutoResize + Columns #1363

john-chapman opened this issue Oct 10, 2017 · 6 comments

Comments

@john-chapman
Copy link

In version 1.52 the behavior of ImGuiWindowFlags_AlwaysAutoResize has changed when using columns to arrange widgets - it looks like the auto resize doesn't account for the columns. This was working in version 1.50:

ImGui::Begin("foo", 0, ImGuiWindowFlags_AlwaysAutoResize);
   ImGui::Columns(4);
       // blah blah
   ImGui::Columns(1);
ImGui::End();

But in 1.52 looks like this:
pasted_image_at_2017_10_10_10_20_am_360

@ocornut
Copy link
Owner

ocornut commented Oct 10, 2017 via email

@ihamer
Copy link

ihamer commented Oct 11, 2017

Can you elaborate on "grow the width yourself"? I would like to try to implement this.

@ocornut
Copy link
Owner

ocornut commented Oct 11, 2017 via email

@L-P
Copy link

L-P commented Jan 25, 2018

Had the same problem, fixed it by specifying a constant width:

ImGui::SetNextWindowSizeConstraints({230, -1}, {230, -1});
ImGui::Begin("SomeWindowWithTextColumns", nullptr, ImGuiWindowFlags_AlwaysAutoResize);

This will set the height automatically and keep the width fixed. Not ideal but it works.

SetNextWindowContentSize did not work with a height of 0.f as it should per stated in the documentation, only SetNextWindowSizeConstraints with a height of -1 correctly adjusts the window height.

As the text shown has a constant width, this worked for me.

ocornut added a commit that referenced this issue Jan 25, 2018
…ontentWidth()) overwriting the contents size. Broken in eab6333. (#1363)
@ocornut
Copy link
Owner

ocornut commented Jan 25, 2018

SetNextWindowContentSize did not work with a height of 0.f as it should per stated in the documentation,

This is a bug introduced in eab6333, pushed a fix now. Thanks.

Test:

ImGui::SetNextWindowContentSize(ImVec2(400, 0.0f));
ImGui::Begin("Test #1363", NULL, ImGuiWindowFlags_AlwaysAutoResize);
ImGui::Columns(4);
ImGui::Text("column 0");
ImGui::Text("blah blah");
ImGui::Columns(1);
ImGui::End();

image

@ocornut
Copy link
Owner

ocornut commented Jan 4, 2022

Closing this as Columns are a Legacy feature.
Tables are reporting their contents so auto-sizing of a Parent Window carrying a Table should work.

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

No branches or pull requests

4 participants