From f6e0953b38ab133b546f21b710abe92a1a561e01 Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 23 Feb 2026 22:18:38 +0100 Subject: [PATCH] TreeNode: moved TreeNodeGetOpen() helper to public API. (#3823, #9251, #7553, #6754, #5423, #2958, #2079, #1947, #1131, #722) Amend 0653a0d --- docs/CHANGELOG.txt | 4 ++++ imgui.h | 1 + imgui_demo.cpp | 1 - 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 941e5aa69..e49d0318c 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -49,6 +49,10 @@ Breaking Changes: Other Changes: +- TreeNode: + - Moved TreeNodeGetOpen() helper to public API. I was hesitant to make this public + because I intend to provide a more generic and feature-full version, but in the meanwhile + this will do. (#3823, #9251, #7553, #6754, #5423, #2958, #2079, #1947, #1131, #722) - Style: border sizes are now scaled (and rounded) by ScaleAllSizes(). - Clipper: - Clear `DisplayStart`/`DisplayEnd` fields when `Step()` returns false. diff --git a/imgui.h b/imgui.h index a0b4c3686..5fe0e8297 100644 --- a/imgui.h +++ b/imgui.h @@ -756,6 +756,7 @@ namespace ImGui IMGUI_API bool CollapsingHeader(const char* label, bool* p_visible, ImGuiTreeNodeFlags flags = 0); // when 'p_visible != NULL': if '*p_visible==true' display an additional small close button on upper right of the header which will set the bool to false when clicked, if '*p_visible==false' don't display the header. IMGUI_API void SetNextItemOpen(bool is_open, ImGuiCond cond = 0); // set next TreeNode/CollapsingHeader open state. IMGUI_API void SetNextItemStorageID(ImGuiID storage_id); // set id to use for open/close storage (default to same as item id). + IMGUI_API bool TreeNodeGetOpen(ImGuiID storage_id); // retrieve tree node open/close state. // Widgets: Selectables // - A selectable highlights when hovered, and can display another color when selected. diff --git a/imgui_demo.cpp b/imgui_demo.cpp index f2baf2345..bdeb98594 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -294,7 +294,6 @@ void* GImGuiDemoMarkerCallbackUserData = NULL; namespace ImGui { IMGUI_API void ShowFontAtlas(ImFontAtlas* atlas); - IMGUI_API bool TreeNodeGetOpen(ImGuiID storage_id); IMGUI_API void TreeNodeSetOpen(ImGuiID storage_id, bool is_open); }