BeginChild Resize to Contents? #1666

Closed
opened 2018-03-06 03:16:11 +00:00 by skl131313 · 2 comments
skl131313 commented 2018-03-06 03:16:11 +00:00 (Migrated from github.com)

Is there a resize to content mode for an axis using ImGui::BeginChild()?

I want to have horizontal scrolling but I don't want there to be vertical scrolling. I want it to resize to the size of the contents vertically. Is there anything like this?

I can manually set a fixed size, but then I need to calculate and compensate for when the horizontal scrollbar might be visible.

Is there a resize to content mode for an axis using `ImGui::BeginChild()`? I want to have horizontal scrolling but I don't want there to be vertical scrolling. I want it to resize to the size of the contents vertically. Is there anything like this? I can manually set a fixed size, but then I need to calculate and compensate for when the horizontal scrollbar might be visible.
ocornut commented 2018-03-07 08:23:29 +00:00 (Migrated from github.com)

Hello @skl131313, unfortunately it isn't possible at the moment. I see what you are trying to do and agree it would be helpful. I have an idea of how to implement it but it's not a trivial change and I don't know when I'll be able to tackle it.

In the meanwhile, maybe using both flags ImGuiWindowFlags_HorizontalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar can allow you to compute that extra height for the scrollbar since it won't change any more.

Hello @skl131313, unfortunately it isn't possible at the moment. I see what you are trying to do and agree it would be helpful. I have an idea of how to implement it but it's not a trivial change and I don't know when I'll be able to tackle it. In the meanwhile, maybe using both flags `ImGuiWindowFlags_HorizontalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar` can allow you to compute that extra height for the scrollbar since it won't change any more.
skl131313 commented 2018-03-07 11:46:32 +00:00 (Migrated from github.com)

No worries if it requires a big change, it's more of a nice to have feature than a requirement.

No worries if it requires a big change, it's more of a nice to have feature than a requirement.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#1666
No description provided.