Browse Source

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
ocornut 2 years ago
parent
commit
9d08506dce
2 changed files with 4 additions and 6 deletions
  1. 2 1
      docs/CHANGELOG.txt
  2. 2 5
      imgui_tables.cpp

+ 2 - 1
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

+ 2 - 5
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);