mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-15 09:13:13 +02:00
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:
@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user