BeginChild(): Added ImGuiChildFlags_FrameStyle as a replacement for BeginChildFrame(). (#1666, #1496, #1395, #1710, #462, #503, #263)

Effectively allows us to avoid extending BeginChildFrame() api to mimic BeginChild() new parameters.
This commit is contained in:
ocornut
2023-11-07 18:28:03 +01:00
parent ab47efd9a0
commit cdbc21a191
5 changed files with 44 additions and 30 deletions

View File

@ -6901,7 +6901,7 @@ bool ImGui::BeginListBox(const char* label, const ImVec2& size_arg)
window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, label_pos + label_size);
}
BeginChildFrame(id, frame_bb.GetSize());
BeginChild(id, frame_bb.GetSize(), ImGuiChildFlags_FrameStyle);
return true;
}
@ -6912,7 +6912,7 @@ void ImGui::EndListBox()
IM_ASSERT((window->Flags & ImGuiWindowFlags_ChildWindow) && "Mismatched BeginListBox/EndListBox calls. Did you test the return value of BeginListBox?");
IM_UNUSED(window);
EndChildFrame();
EndChild();
EndGroup(); // This is only required to be able to do IsItemXXX query on the whole ListBox including label
}