From 28a283b4603dee1501efd7725acf206ff2e89a3e Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 21 May 2024 10:54:30 +0200 Subject: [PATCH] Windows: BeginChild(), Tables:fixed visibility of fully clipped child windows and tables to Test Engine. --- docs/CHANGELOG.txt | 1 + imgui.cpp | 4 +++- imgui.h | 2 +- imgui_tables.cpp | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 85aadeae0..640f99a4f 100644 --- a/docs/CHANGELOG.txt +++ b/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] diff --git a/imgui.cpp b/imgui.cpp index 25ad3a790..7f16bf044 100644 --- a/imgui.cpp +++ b/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) diff --git a/imgui.h b/imgui.h index c8ea96803..cf681ce1d 100644 --- a/imgui.h +++ b/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 /* diff --git a/imgui_tables.cpp b/imgui_tables.cpp index 162083793..ce8f81a44 100644 --- a/imgui_tables.cpp +++ b/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