Skip to content

Commit 605c8d7

Browse files
committed
Demo: Property Editor: using ImGuiChildFlags_NavFlattened now that a bug is fixed. Fixed static analyzer.
1 parent 97ff9bd commit 605c8d7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

imgui_demo.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -8615,8 +8615,7 @@ struct ExampleAppPropertyEditor
86158615
{
86168616
// Left side: draw tree
86178617
// - Currently using a table to benefit from RowBg feature
8618-
// - Using ImGuiChildFlags_NavFlattened exhibit a bug where clicking on root window decoration sets focus to root window
8619-
if (ImGui::BeginChild("##tree", ImVec2(300, 0), ImGuiChildFlags_ResizeX | ImGuiChildFlags_Border))
8618+
if (ImGui::BeginChild("##tree", ImVec2(300, 0), ImGuiChildFlags_ResizeX | ImGuiChildFlags_Border | ImGuiChildFlags_NavFlattened))
86208619
{
86218620
ImGui::SetNextItemWidth(-FLT_MIN);
86228621
ImGui::SetNextItemShortcut(ImGuiMod_Ctrl | ImGuiKey_F, ImGuiInputFlags_Tooltip);
@@ -8648,8 +8647,7 @@ struct ExampleAppPropertyEditor
86488647
{
86498648
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed);
86508649
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch, 2.0f); // Default twice larger
8651-
8652-
if (node && node->HasData)
8650+
if (node->HasData)
86538651
{
86548652
// In a typical application, the structure description would be derived from a data-driven system.
86558653
// - We try to mimic this with our ExampleMemberInfo structure and the ExampleTreeNodeMemberInfos[] array.
@@ -8714,10 +8712,11 @@ struct ExampleAppPropertyEditor
87148712
if (ImGui::IsItemFocused())
87158713
VisibleNode = node;
87168714
if (node_open)
8715+
{
87178716
for (ExampleTreeNode* child : node->Childs)
87188717
DrawTreeNode(child);
8719-
if (node_open)
87208718
ImGui::TreePop();
8719+
}
87218720
ImGui::PopID();
87228721
}
87238722
};

0 commit comments

Comments
 (0)