Note this is meant to be stored in column->WidthAuto, please generally use the WidthAuto field
| 2125 | |
| 2126 | // Note this is meant to be stored in column->WidthAuto, please generally use the WidthAuto field |
| 2127 | float ImGui::TableGetColumnWidthAuto(ImGuiTable* table, ImGuiTableColumn* column) |
| 2128 | { |
| 2129 | const float content_width_body = ImMax(column->ContentMaxXFrozen, column->ContentMaxXUnfrozen) - column->WorkMinX; |
| 2130 | const float content_width_headers = column->ContentMaxXHeadersIdeal - column->WorkMinX; |
| 2131 | float width_auto = content_width_body; |
| 2132 | if (!(column->Flags & ImGuiTableColumnFlags_NoHeaderWidth)) |
| 2133 | width_auto = ImMax(width_auto, content_width_headers); |
| 2134 | |
| 2135 | // Non-resizable fixed columns preserve their requested width |
| 2136 | if ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && column->InitStretchWeightOrWidth > 0.0f) |
| 2137 | if (!(table->Flags & ImGuiTableFlags_Resizable) || (column->Flags & ImGuiTableColumnFlags_NoResize)) |
| 2138 | width_auto = column->InitStretchWeightOrWidth; |
| 2139 | |
| 2140 | return ImMax(width_auto, table->MinColumnWidth); |
| 2141 | } |
| 2142 | |
| 2143 | // 'width' = inner column width, without padding |
| 2144 | void ImGui::TableSetColumnWidth(int column_n, float width) |