From 9d08506dce4a0b32a065a37e376fe3a4c232388e Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 6 Dec 2022 22:11:51 +0100 Subject: [PATCH] Tables, Nav: frozen columns are not part of menu layer and can be crossed over. (#5143, #3692) Frozen rows (~header) still moving from menu to main layer based on freezing stat.e --- docs/CHANGELOG.txt | 3 ++- imgui_tables.cpp | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index a32ee347b..0c69abdd8 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -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 diff --git a/imgui_tables.cpp b/imgui_tables.cpp index 881eafa1f..61bda047f 100644 --- a/imgui_tables.cpp +++ b/imgui_tables.cpp @@ -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) { @@ -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);