Tables: context menu now present columns in display order. (#9312)

This commit is contained in:
ocornut
2026-03-20 21:22:53 +01:00
parent 505bc9a312
commit 836278db6c
2 changed files with 3 additions and 1 deletions

View File

@@ -93,6 +93,7 @@ Other Changes:
using the idiom of not applying edits before IsItemDeactivatedAfterEdit().
(#9308, #8915, #8273)
- Tables:
- Context menu now presents columns in display order. (#9312)
- Fixed and clarified the behavior of using TableSetupScrollFreeze() with columns>1,
and where some of the columns within that range were Hidable.
- Before: TableSetupScrollFreeze(N, 0) made the first N _visible_ columns

View File

@@ -3574,8 +3574,9 @@ void ImGui::TableDrawDefaultContextMenu(ImGuiTable* table, ImGuiTableFlags flags
want_separator = true;
PushItemFlag(ImGuiItemFlags_AutoClosePopups, false);
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
{
const int column_n = table->DisplayOrderToIndex[order_n];
ImGuiTableColumn* column = &table->Columns[column_n];
if (column->Flags & ImGuiTableColumnFlags_Disabled)
continue;