Note this is meant to be stored in column->WidthAuto, please generally use the WidthAuto field
| 2320 | |
| 2321 | // Note this is meant to be stored in column->WidthAuto, please generally use the WidthAuto field |
| 2322 | float ImGui::TableGetColumnWidthAuto(ImGuiTable* table, ImGuiTableColumn* column) |
| 2323 | { |
| 2324 | const float content_width_body = ImMax(column->ContentMaxXFrozen, column->ContentMaxXUnfrozen) - column->WorkMinX; |
| 2325 | const float content_width_headers = column->ContentMaxXHeadersIdeal - column->WorkMinX; |
| 2326 | float width_auto = content_width_body; |
| 2327 | if (!(column->Flags & ImGuiTableColumnFlags_NoHeaderWidth)) |
| 2328 | width_auto = ImMax(width_auto, content_width_headers); |
| 2329 | |
| 2330 | // Non-resizable fixed columns preserve their requested width |
| 2331 | if ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && column->InitStretchWeightOrWidth > 0.0f) |
| 2332 | if (!(table->Flags & ImGuiTableFlags_Resizable) || (column->Flags & ImGuiTableColumnFlags_NoResize)) |
| 2333 | width_auto = column->InitStretchWeightOrWidth; |
| 2334 | |
| 2335 | return ImMax(width_auto, table->MinColumnWidth); |
| 2336 | } |
| 2337 | |
| 2338 | // 'width' = inner column width, without padding |
| 2339 | void ImGui::TableSetColumnWidth(int column_n, float width) |