mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 13:08:47 +02:00
TreeNode: Added IsItemToggledOpen() to explicitly query if item was just open/closed, facilitating interactions with custom multi-selections patterns. (#1896, #1861)
This commit is contained in:
@ -5291,9 +5291,9 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
|
||||
|
||||
bool hovered, held;
|
||||
bool pressed = ButtonBehavior(interact_bb, id, &hovered, &held, button_flags);
|
||||
bool toggled = false;
|
||||
if (!is_leaf)
|
||||
{
|
||||
bool toggled = false;
|
||||
if (pressed)
|
||||
{
|
||||
if ((flags & (ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick)) == 0 || (g.NavActivateId == id))
|
||||
@ -5321,6 +5321,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
|
||||
{
|
||||
is_open = !is_open;
|
||||
window->DC.StateStorage->SetInt(id, is_open);
|
||||
window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_ToggledOpen;
|
||||
}
|
||||
}
|
||||
if (flags & ImGuiTreeNodeFlags_AllowItemOverlap)
|
||||
|
Reference in New Issue
Block a user