From 30e21eb2805e90039e3f628705910056b13d398f Mon Sep 17 00:00:00 2001 From: omar Date: Tue, 21 Jul 2020 14:36:31 +0200 Subject: [PATCH] Tables: non-resizable columns also submit their requested width for auto-fit, --- imgui_tables.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/imgui_tables.cpp b/imgui_tables.cpp index 2ead3fd8..4167fd49 100644 --- a/imgui_tables.cpp +++ b/imgui_tables.cpp @@ -614,6 +614,12 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) column_width_ideal = ImMax(column_width_ideal, column_content_width_headers); column_width_ideal = ImMax(column_width_ideal + padding_auto_x, min_column_width); + // Non-resizable columns also submit their requested width + if (column->Flags & ImGuiTableColumnFlags_WidthFixed) + if (column->WidthOrWeightInitValue > 0.0f) + if (!(table->Flags & ImGuiTableFlags_Resizable) || !(column->Flags & ImGuiTableColumnFlags_NoResize)) + column_width_ideal = ImMax(column_width_ideal, column->WidthOrWeightInitValue); + // CellSpacingX is >0.0f when there's no vertical border table->ColumnsAutoFitWidth += column_width_ideal; if (column->PrevVisibleColumn != -1)