mirror of
https://github.com/ocornut/imgui.git
synced 2026-08-03 14:19:25 +00:00
Merge branch 'master' into docking
# Conflicts: # imgui.cpp
This commit is contained in:
@@ -6870,6 +6870,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)
|
||||
@@ -6899,7 +6900,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)
|
||||
{
|
||||
@@ -6908,7 +6909,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;
|
||||
}
|
||||
|
||||
@@ -6919,7 +6920,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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user