Skip to content

Commit

Permalink
Tables: fixed an issue where Columns Visible/Hidden state wouldn't be…
Browse files Browse the repository at this point in the history
… correctly overridden when hot-reloading .ini state. (ocornut#7934)
  • Loading branch information
ocornut committed Feb 10, 2025
1 parent 88cda0c commit 4dc9df6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ Other changes:
which amusingly made it disappear when using very big font/frame size.
- Tables: fixed calling SetNextWindowScroll() on clipped scrolling table
to not leak the value into a subsequent window. (#8196)
- Tables: fixed an issue where Columns Visible/Hidden state wouldn't be correctly
overridden when hot-reloading .ini state. (#7934)
- TextLinkOpenURL(): fixed default Win32 io.PlatformOpenInShellFn handler to
handle UTF-8 regardless of system regional settings. (#7660) [@achabense]
- Demo: Combos: demonstrate a very simple way to add a filter to a combo,
Expand All @@ -67,6 +69,7 @@ Other changes:
- Backends: WebGPU: Fix for DAWN API rename WGPUProgrammableStageDescriptor -> WGPUComputeState.
[@PhantomCloak] (#8369)


-----------------------------------------------------------------------
VERSION 1.91.8 (Released 2025-01-31)
-----------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions imgui_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -2944,7 +2944,7 @@ struct ImGuiTableColumnSettings
ImGuiTableColumnIdx DisplayOrder;
ImGuiTableColumnIdx SortOrder;
ImU8 SortDirection : 2;
ImU8 IsEnabled : 1; // "Visible" in ini file
ImS8 IsEnabled : 2; // "Visible" in ini file
ImU8 IsStretch : 1;

ImGuiTableColumnSettings()
Expand All @@ -2954,7 +2954,7 @@ struct ImGuiTableColumnSettings
Index = -1;
DisplayOrder = SortOrder = -1;
SortDirection = ImGuiSortDirection_None;
IsEnabled = 1;
IsEnabled = -1;
IsStretch = 0;
}
};
Expand Down
2 changes: 1 addition & 1 deletion imgui_tables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3741,7 +3741,7 @@ void ImGui::TableLoadSettings(ImGuiTable* table)
else
column->DisplayOrder = (ImGuiTableColumnIdx)column_n;
display_order_mask |= (ImU64)1 << column->DisplayOrder;
column->IsUserEnabled = column->IsUserEnabledNextFrame = column_settings->IsEnabled;
column->IsUserEnabled = column->IsUserEnabledNextFrame = (column_settings->IsEnabled != -1 ? column_settings->IsEnabled == 1 : (column->Flags & ImGuiTableColumnFlags_DefaultHide) ? 0 : 1);
column->SortOrder = column_settings->SortOrder;
column->SortDirection = column_settings->SortDirection;
}
Expand Down

0 comments on commit 4dc9df6

Please sign in to comment.