imgui
imgui copied to clipboard
Stretch table to window scrollable size
Version/Branch of Dear ImGui:
1.90.1, docking
Back-ends:
Custom (Unreal)
Compiler, OS:
Windows 11, MSVC 2022
Full config/build information:
No response
Details:
I have a table in a window that has ImGuiWindowFlags_HorizontalScrollbar. If the window is too narrow for its contents and the horizontal scrollbar appears I'd like the table to stretch to the width of the window contents, instead of the physical window itself.
I don't think I can get the content size and specify the table width manually since that forms a feedback loop where the table can never get narrower.
Is this a supported use case?
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
if (ImGui::Begin("Window", nullptr, ImGuiWindowFlags_HorizontalScrollbar))
{
ImGui::Button("Button", ImVec2(400, 20));
auto Flags = ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersInnerV;
if (ImGui::BeginTable("Table", 2, Flags))
{
ImGui::TableSetupColumn("One");
ImGui::TableSetupColumn("Two");
ImGui::TableHeadersRow();
ImGui::TableNextColumn();
ImGui::Text("Content");
ImGui::TableNextColumn();
ImGui::Text("Content");
ImGui::EndTable();
}
}
ImGui::End();
any update on this?