Comments in demo and opengl code + Internals: Added HoveredIdNotActiveTimer tracking hovering time unless the item is active, which is a commonly useful pattern.

This commit is contained in:
omar
2018-10-25 17:31:16 +02:00
parent e610afeea3
commit ac9aaf4b6e
4 changed files with 26 additions and 18 deletions

View File

@ -662,7 +662,8 @@ struct ImGuiContext
ImGuiID HoveredId; // Hovered widget
bool HoveredIdAllowOverlap;
ImGuiID HoveredIdPreviousFrame;
float HoveredIdTimer;
float HoveredIdTimer; // Measure contiguous hovering time
float HoveredIdNotActiveTimer; // Measure contiguous hovering time where the item has not been active
ImGuiID ActiveId; // Active widget
ImGuiID ActiveIdPreviousFrame;
ImGuiID ActiveIdIsAlive; // Active widget has been seen this frame (we can't use a bool as the ActiveId may change within the frame)
@ -809,7 +810,7 @@ struct ImGuiContext
HoveredId = 0;
HoveredIdAllowOverlap = false;
HoveredIdPreviousFrame = 0;
HoveredIdTimer = 0.0f;
HoveredIdTimer = HoveredIdNotActiveTimer = 0.0f;
ActiveId = 0;
ActiveIdPreviousFrame = 0;
ActiveIdIsAlive = 0;