Better documented the difference between BeginListBox() and BeginChild() w/ ImGuiChildFlags_FrameStyle.

BeginListBox() can't yet expose child flags because coarse clipping require query of stored size (same issue as with adding resize support to Tables).
This commit is contained in:
ocornut
2023-11-07 20:14:54 +01:00
parent fa4c49b4a7
commit 44345c2108
4 changed files with 11 additions and 11 deletions

View File

@ -6863,6 +6863,7 @@ void ImGui::SetNextItemSelectionUserData(ImGuiSelectionUserData selection_user_d
// - ListBox()
//-------------------------------------------------------------------------
// This is essentially a thin wrapper to using BeginChild/EndChild with the ImGuiChildFlags_FrameStyle flag for stylistic changes + displaying a label.
// Tip: To have a list filling the entire window width, use size.x = -FLT_MIN and pass an non-visible label e.g. "##empty"
// Tip: If your vertical size is calculated from an item count (e.g. 10 * item_height) consider adding a fractional part to facilitate seeing scrolling boundaries (e.g. 10.25 * item_height).
bool ImGui::BeginListBox(const char* label, const ImVec2& size_arg)
@ -6892,7 +6893,7 @@ bool ImGui::BeginListBox(const char* label, const ImVec2& size_arg)
return false;
}
// FIXME-OPT: We could omit the BeginGroup() if label_size.x but would need to omit the EndGroup() as well.
// FIXME-OPT: We could omit the BeginGroup() if label_size.x == 0.0f but would need to omit the EndGroup() as well.
BeginGroup();
if (label_size.x > 0.0f)
{