Skip to content

Commit

Permalink
Tables, Nav: frozen columns are not part of menu layer and can be cro…
Browse files Browse the repository at this point in the history
…ssed over. (#5143, #3692)

Frozen rows (~header) still moving from menu to main layer based on freezing stat.e
  • Loading branch information
ocornut committed Dec 6, 2022
1 parent fd0b373 commit 9d08506
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 2 additions & 1 deletion docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ Other changes:
debugging, Allegro). (#4857, #5937)
- Tables, Nav, Scrolling: fixed scrolling functions and focus tracking with frozen rows and
frozen columns. Windows now have a better understanding of outer/inner decoration sizes,
which should later lead us toward more flexible uses of menu/status bars. (#5143, #4868, #3692)
which should later lead us toward more flexible uses of menu/status bars. (#5143, #3692)
- Tables, Nav: frozen columns are not part of menu layer and can be crossed over. (#5143, #3692)
- Tables, Columns: fixed cases where empty columns may lead to empty ImDrawCmd. (#4857, #5937)
- Inputs, IO: reworked ImGuiMod_Shortcut to redirect to Ctrl/Super at runtime instead of
compile-time, being consistent with our support for io.ConfigMacOSXBehaviors and making it
Expand Down
7 changes: 2 additions & 5 deletions imgui_tables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
const int column_n = table->DisplayOrderToIndex[order_n];
ImGuiTableColumn* column = &table->Columns[column_n];

column->NavLayerCurrent = (ImS8)((table->FreezeRowsCount > 0 || column_n < table->FreezeColumnsCount) ? ImGuiNavLayer_Menu : ImGuiNavLayer_Main);
column->NavLayerCurrent = (ImS8)(table->FreezeRowsCount > 0 ? ImGuiNavLayer_Menu : ImGuiNavLayer_Main); // Use Count NOT request so Header line changes layer when frozen

if (offset_x_frozen && table->FreezeColumnsCount == visible_n)
{
Expand Down Expand Up @@ -1846,10 +1846,7 @@ void ImGui::TableEndRow(ImGuiTable* table)
// get the new cursor position.
if (unfreeze_rows_request)
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
{
ImGuiTableColumn* column = &table->Columns[column_n];
column->NavLayerCurrent = (ImS8)((column_n < table->FreezeColumnsCount) ? ImGuiNavLayer_Menu : ImGuiNavLayer_Main);
}
table->Columns[column_n].NavLayerCurrent = ImGuiNavLayer_Main;
if (unfreeze_rows_actual)
{
IM_ASSERT(table->IsUnfrozenRows == false);
Expand Down

0 comments on commit 9d08506

Please sign in to comment.