Skip to content

Commit 8ee8513

Browse files
committed
BeginChild(): Internal name used by child windows now omits the hash/id if the child window is submitted in root of id stack of parent window.
# Conflicts: # docs/CHANGELOG.txt # imgui.h
1 parent 4e4042b commit 8ee8513

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

docs/CHANGELOG.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ Other changes:
7171
Previously was inconsistent and only enabled when stepping through a non-input item.
7272
(#6802, #3092, #5759, #787)
7373
- Windows:
74+
- BeginChild(): Internal name used by child windows now omits the hash/id if the child
75+
window is submitted in root of id stack of parent window. Makes debugging/metrics easier
76+
and shorter to read in many cases.
7477
- Popups: clarified meaning of 'p_open != NULL' in BeginPopupModal() + set back user value
7578
to false when popup is closed in ways other than clicking the close button. (#6900)
7679
- Double-clicking lower-left resize grip auto-resize (like lower-rightone).

imgui.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5444,7 +5444,9 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b
54445444

54455445
// Build up name. If you need to append to a same child from multiple location in the ID stack, use BeginChild(ImGuiID id) with a stable value.
54465446
const char* temp_window_name;
5447-
if (name)
5447+
if (name && parent_window->IDStack.back() == parent_window->ID)
5448+
ImFormatStringToTempBuffer(&temp_window_name, NULL, "%s/%s", parent_window->Name, name); // May omit ID if in root of ID stack
5449+
else if (name)
54485450
ImFormatStringToTempBuffer(&temp_window_name, NULL, "%s/%s_%08X", parent_window->Name, name, id);
54495451
else
54505452
ImFormatStringToTempBuffer(&temp_window_name, NULL, "%s/%08X", parent_window->Name, id);

imgui.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// Library Version
2525
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
2626
#define IMGUI_VERSION "1.90 WIP"
27-
#define IMGUI_VERSION_NUM 18995
27+
#define IMGUI_VERSION_NUM 18996
2828
#define IMGUI_HAS_TABLE
2929

3030
/*

0 commit comments

Comments
 (0)