Called in TableSetupColumn() when initializing and in TableLoadSettings() for defaults before applying stored settings. 'init_mask' specify which fields to initialize.
| 1572 | // Called in TableSetupColumn() when initializing and in TableLoadSettings() for defaults before applying stored settings. |
| 1573 | // 'init_mask' specify which fields to initialize. |
| 1574 | static void TableInitColumnDefaults(ImGuiTable* table, ImGuiTableColumn* column, ImGuiTableColumnFlags init_mask) |
| 1575 | { |
| 1576 | ImGuiTableColumnFlags flags = column->Flags; |
| 1577 | if (init_mask & ImGuiTableFlags_Resizable) |
| 1578 | { |
| 1579 | float init_width_or_weight = column->InitStretchWeightOrWidth; |
| 1580 | column->WidthRequest = ((flags & ImGuiTableColumnFlags_WidthFixed) && init_width_or_weight > 0.0f) ? init_width_or_weight : -1.0f; |
| 1581 | column->StretchWeight = (init_width_or_weight > 0.0f && (flags & ImGuiTableColumnFlags_WidthStretch)) ? init_width_or_weight : -1.0f; |
| 1582 | if (init_width_or_weight > 0.0f) // Disable auto-fit if an explicit width/weight has been specified |
| 1583 | column->AutoFitQueue = 0x00; |
| 1584 | } |
| 1585 | if (init_mask & ImGuiTableFlags_Reorderable) |
| 1586 | column->DisplayOrder = (ImGuiTableColumnIdx)table->Columns.index_from_ptr(column); |
| 1587 | if (init_mask & ImGuiTableFlags_Hideable) |
| 1588 | column->IsUserEnabled = column->IsUserEnabledNextFrame = (flags & ImGuiTableColumnFlags_DefaultHide) ? 0 : 1; |
| 1589 | if (init_mask & ImGuiTableFlags_Sortable) |
| 1590 | { |
| 1591 | // Multiple columns using _DefaultSort will be reassigned unique SortOrder values when building the sort specs. |
| 1592 | column->SortOrder = (flags & ImGuiTableColumnFlags_DefaultSort) ? 0 : -1; |
| 1593 | column->SortDirection = (flags & ImGuiTableColumnFlags_DefaultSort) ? ((flags & ImGuiTableColumnFlags_PreferSortDescending) ? (ImS8)ImGuiSortDirection_Descending : (ImU8)(ImGuiSortDirection_Ascending)) : (ImS8)ImGuiSortDirection_None; |
| 1594 | } |
| 1595 | } |
| 1596 | |
| 1597 | // See "COLUMNS SIZING POLICIES" comments at the top of this file |
| 1598 | // If (init_width_or_weight <= 0.0f) it is ignored |
no outgoing calls
no test coverage detected