@@ -913,6 +913,7 @@ bool ImGui::Checkbox(const char* label, bool* v)
913
913
if (label_size.x > 0 .0f )
914
914
RenderText (text_bb.Min , label);
915
915
916
+ IMGUI_TEST_ENGINE_ITEM_INFO (id, label, window->DC .ItemFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0 ));
916
917
return pressed;
917
918
}
918
919
@@ -4760,6 +4761,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
4760
4761
// (Ideally we'd want to add a flag for the user to specify if we want the hit test to be done up to the right side of the content or not)
4761
4762
const ImRect interact_bb = display_frame ? frame_bb : ImRect (frame_bb.Min .x , frame_bb.Min .y , frame_bb.Min .x + text_width + style.ItemSpacing .x *2 , frame_bb.Max .y );
4762
4763
bool is_open = TreeNodeBehaviorIsOpen (id, flags);
4764
+ bool is_leaf = (flags & ImGuiTreeNodeFlags_Leaf) != 0 ;
4763
4765
4764
4766
// Store a flag for the current depth to tell if we will allow closing this node when navigating one of its child.
4765
4767
// For this purpose we essentially compare if g.NavIdIsAlive went from 0 to 1 between TreeNode() and TreePop().
@@ -4775,6 +4777,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
4775
4777
{
4776
4778
if (is_open && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen))
4777
4779
TreePushRawID (id);
4780
+ IMGUI_TEST_ENGINE_ITEM_INFO (window->DC .LastItemId , label, window->DC .ItemFlags | (is_leaf ? 0 : ImGuiItemStatusFlags_Openable) | (is_open ? ImGuiItemStatusFlags_Opened : 0 ));
4778
4781
return is_open;
4779
4782
}
4780
4783
@@ -4784,13 +4787,13 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
4784
4787
// - OpenOnArrow .................... single-click on arrow to open
4785
4788
// - OpenOnDoubleClick|OpenOnArrow .. single-click on arrow or double-click anywhere to open
4786
4789
ImGuiButtonFlags button_flags = ImGuiButtonFlags_NoKeyModifiers | ((flags & ImGuiTreeNodeFlags_AllowItemOverlap) ? ImGuiButtonFlags_AllowItemOverlap : 0 );
4787
- if (!(flags & ImGuiTreeNodeFlags_Leaf) )
4790
+ if (!is_leaf )
4788
4791
button_flags |= ImGuiButtonFlags_PressedOnDragDropHold;
4789
4792
if (flags & ImGuiTreeNodeFlags_OpenOnDoubleClick)
4790
4793
button_flags |= ImGuiButtonFlags_PressedOnDoubleClick | ((flags & ImGuiTreeNodeFlags_OpenOnArrow) ? ImGuiButtonFlags_PressedOnClickRelease : 0 );
4791
4794
4792
4795
bool hovered, held, pressed = ButtonBehavior (interact_bb, id, &hovered, &held, button_flags);
4793
- if (!(flags & ImGuiTreeNodeFlags_Leaf) )
4796
+ if (!is_leaf )
4794
4797
{
4795
4798
bool toggled = false ;
4796
4799
if (pressed)
@@ -4858,7 +4861,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
4858
4861
4859
4862
if (flags & ImGuiTreeNodeFlags_Bullet)
4860
4863
RenderBullet (frame_bb.Min + ImVec2 (text_offset_x * 0 .5f , g.FontSize *0 .50f + text_base_offset_y));
4861
- else if (!(flags & ImGuiTreeNodeFlags_Leaf) )
4864
+ else if (!is_leaf )
4862
4865
RenderArrow (frame_bb.Min + ImVec2 (padding.x , g.FontSize *0 .15f + text_base_offset_y), is_open ? ImGuiDir_Down : ImGuiDir_Right, 0 .70f );
4863
4866
if (g.LogEnabled )
4864
4867
LogRenderedText (&text_pos, " >" );
@@ -4867,6 +4870,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
4867
4870
4868
4871
if (is_open && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen))
4869
4872
TreePushRawID (id);
4873
+ IMGUI_TEST_ENGINE_ITEM_INFO (id, label, window->DC .ItemFlags | (is_leaf ? 0 : ImGuiItemStatusFlags_Openable) | (is_open ? ImGuiItemStatusFlags_Opened : 0 ));
4870
4874
return is_open;
4871
4875
}
4872
4876
@@ -5650,6 +5654,8 @@ bool ImGui::BeginMenu(const char* label, bool enabled)
5650
5654
if (want_close && IsPopupOpen (id))
5651
5655
ClosePopupToLevel (g.CurrentPopupStack .Size );
5652
5656
5657
+ IMGUI_TEST_ENGINE_ITEM_INFO (id, label, window->DC .ItemFlags | ImGuiItemStatusFlags_Openable | (menu_is_open ? ImGuiItemStatusFlags_Opened : 0 ));
5658
+
5653
5659
if (!menu_is_open && want_open && g.OpenPopupStack .Size > g.CurrentPopupStack .Size )
5654
5660
{
5655
5661
// Don't recycle same menu level in the same frame, first close the other menu and yield for a frame.
@@ -5729,6 +5735,8 @@ bool ImGui::MenuItem(const char* label, const char* shortcut, bool selected, boo
5729
5735
if (selected)
5730
5736
RenderCheckMark (pos + ImVec2 (window->MenuColumns .Pos [2 ] + extra_w + g.FontSize * 0 .40f , g.FontSize * 0 .134f * 0 .5f ), GetColorU32 (enabled ? ImGuiCol_Text : ImGuiCol_TextDisabled), g.FontSize * 0 .866f );
5731
5737
}
5738
+
5739
+ IMGUI_TEST_ENGINE_ITEM_INFO (window->DC .LastItemId , label, window->DC .ItemFlags | ImGuiItemStatusFlags_Checkable | (selected ? ImGuiItemStatusFlags_Checked : 0 ));
5732
5740
return pressed;
5733
5741
}
5734
5742
0 commit comments