mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
CollapsingHeader: Added support for ImGuiTreeNodeFlags_Bullet and ImGuiTreeNodeFlags_Leaf on framed nodes. (#2159, #2160)
The Bullet and Leaf ImGuiTreeNodeFlags are now taken into account for Framed/CollapsingHeader tree nodes as well. TreeNodeEx() can be used to specify these flags. A choice was made to left-adjust the Framed text when no Bullet/Arrow is rendered, since this was deemed to look better in the Framed context (especially when considering that CollapsingHeader is drawn using NoTreePushOnOpen, so child/sibling Text items etc will often be non-indented).
This commit is contained in:
@ -677,7 +677,7 @@ static void ShowDemoWindowWidgets()
|
||||
{
|
||||
static bool closable_group = true;
|
||||
ImGui::Checkbox("Show 2nd header", &closable_group);
|
||||
if (ImGui::CollapsingHeader("Header"))
|
||||
if (ImGui::CollapsingHeader("Header", ImGuiTreeNodeFlags_None))
|
||||
{
|
||||
ImGui::Text("IsItemHovered: %d", ImGui::IsItemHovered());
|
||||
for (int i = 0; i < 5; i++)
|
||||
@ -689,6 +689,10 @@ static void ShowDemoWindowWidgets()
|
||||
for (int i = 0; i < 5; i++)
|
||||
ImGui::Text("More content %d", i);
|
||||
}
|
||||
/*
|
||||
if (ImGui::CollapsingHeader("Header with a bullet", ImGuiTreeNodeFlags_Bullet))
|
||||
ImGui::Text("IsItemHovered: %d", ImGui::IsItemHovered());
|
||||
*/
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
@ -696,6 +700,11 @@ static void ShowDemoWindowWidgets()
|
||||
{
|
||||
ImGui::BulletText("Bullet point 1");
|
||||
ImGui::BulletText("Bullet point 2\nOn multiple lines");
|
||||
if (ImGui::TreeNode("Tree node"))
|
||||
{
|
||||
ImGui::BulletText("Another bullet point");
|
||||
ImGui::TreePop();
|
||||
}
|
||||
ImGui::Bullet(); ImGui::Text("Bullet point 3 (two calls)");
|
||||
ImGui::Bullet(); ImGui::SmallButton("Button");
|
||||
ImGui::TreePop();
|
||||
|
Reference in New Issue
Block a user