From e32b72c12c1fce097c86868249bfbdf4a53de923 Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 19 Oct 2020 18:25:53 +0200 Subject: [PATCH] Begin: WIP consistent Begin/End behavior, ListBoxHeader() fix. --- imgui_widgets.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 3edc0119..265061fd 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -6133,7 +6133,10 @@ bool ImGui::ListBoxHeader(const char* label, const ImVec2& size_arg) RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label); // FIXME-NEWBEGIN: Use to be return true so we'll trigger more issues. - return BeginChildFrame(id, frame_bb.GetSize()); + bool ret = BeginChildFrame(id, frame_bb.GetSize()); + if (!ret) + EndGroup(); + return ret; } // FIXME: In principle this function should be called EndListBox(). We should rename it after re-evaluating if we want to keep the same signature.