mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-05 20:48:46 +02:00
CollapsingHeader(bool*) variant: fixed for IsItemHovered() to work properly in the nav branch.Basically the close button now has to use ItemAdd() to be navable into, which overwrite the IsItemHovered data. (#600, #787)
This commit is contained in:
@ -454,14 +454,16 @@ void ImGui::ShowTestWindow(bool* p_open)
|
||||
if (ImGui::TreeNode("Collapsing Headers"))
|
||||
{
|
||||
static bool closable_group = true;
|
||||
ImGui::Checkbox("Enable extra group", &closable_group);
|
||||
if (ImGui::CollapsingHeader("Header"))
|
||||
{
|
||||
ImGui::Checkbox("Enable extra group", &closable_group);
|
||||
ImGui::Text("IsItemHovered: %d", IsItemHovered());
|
||||
for (int i = 0; i < 5; i++)
|
||||
ImGui::Text("Some content %d", i);
|
||||
}
|
||||
if (ImGui::CollapsingHeader("Header with a close button", &closable_group))
|
||||
{
|
||||
ImGui::Text("IsItemHovered: %d", IsItemHovered());
|
||||
for (int i = 0; i < 5; i++)
|
||||
ImGui::Text("More content %d", i);
|
||||
}
|
||||
|
Reference in New Issue
Block a user