Browse Source

Windows: BeginChild(), Tables:fixed visibility of fully clipped child windows and tables to Test Engine.

ocornut 1 year ago
parent
commit
28a283b460
4 changed files with 7 additions and 2 deletions
  1. 1 0
      docs/CHANGELOG.txt
  2. 3 1
      imgui.cpp
  3. 1 1
      imgui.h
  4. 2 0
      imgui_tables.cpp

+ 1 - 0
docs/CHANGELOG.txt

@@ -62,6 +62,7 @@ Other changes:
 - Inputs: (OSX) Ctrl+Left Click alias as a Right click. (#2343) [@haldean, @ocornut]
 - Inputs: Fixed ImGui::GetKeyName(ImGuiKey_None) from returning "N/A" or "None" depending
   on value of IMGUI_DISABLE_OBSOLETE_KEYIO. It always returns "None".
+- Windows: BeginChild(): fixed visibility of fully clipped child windows and tables to Test Engine.
 - Nav: fixed holding Ctrl or gamepad L1 from not slowing down keyboard/gamepad tweak speed.
   Broken during a refactor refactor for 1.89. Holding Shift/R1 to speed up wasn't broken.
 - Tables: fixed cell background of fully clipped row overlapping with header. (#7575, #7041) [@prabuinet]

+ 3 - 1
imgui.cpp

@@ -5612,7 +5612,9 @@ void ImGui::EndChild()
         else
         {
             // Not navigable into
-            ItemAdd(bb, 0);
+            // - This is a bit of a fringe use case, mostly useful for undecorated, non-scrolling contents childs, or empty childs.
+            // - We could later decide to not apply this path if ImGuiChildFlags_FrameStyle or ImGuiChildFlags_Borders is set.
+            ItemAdd(bb, child_window->ChildId, NULL, ImGuiItemFlags_NoNav);
 
             // But when flattened we directly reach items, adjust active layer mask accordingly
             if (child_window->Flags & ImGuiWindowFlags_NavFlattened)

+ 1 - 1
imgui.h

@@ -28,7 +28,7 @@
 // Library Version
 // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
 #define IMGUI_VERSION       "1.90.7 WIP"
-#define IMGUI_VERSION_NUM   19064
+#define IMGUI_VERSION_NUM   19065
 #define IMGUI_HAS_TABLE
 
 /*

+ 2 - 0
imgui_tables.cpp

@@ -328,6 +328,7 @@ bool    ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
     if (use_child_window && IsClippedEx(outer_rect, 0) && !outer_window_is_measuring_size)
     {
         ItemSize(outer_rect);
+        ItemAdd(outer_rect, id);
         return false;
     }
 
@@ -1462,6 +1463,7 @@ void    ImGui::EndTable()
     // CursorPosPrevLine and CursorMaxPos manually. That should be a more general layout feature, see same problem e.g. #3414)
     if (inner_window != outer_window)
     {
+        inner_window->DC.NavLayersActiveMask |= 1 << ImGuiNavLayer_Main; // So empty table don't appear to navigate differently.
         EndChild();
     }
     else