mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-07 13:35:49 +02:00
Nav, TreeNode: Pressing Left with ImGuiTreeNodeFlags_NavLeftJumpsBackHere now goes through proper navigation logic: honor scrolling and selection. (#1079, #1131)
Added a stack for this purpose which other features might build on (e.g. #2920). However this is currently gated by many tests and not a performance concern, but making stack happen all the time may be undesirable.
This commit is contained in:
14
imgui.cpp
14
imgui.cpp
@ -3653,6 +3653,7 @@ void ImGui::Shutdown()
|
||||
g.FontStack.clear();
|
||||
g.OpenPopupStack.clear();
|
||||
g.BeginPopupStack.clear();
|
||||
g.NavTreeNodeStack.clear();
|
||||
|
||||
g.Viewports.clear_delete();
|
||||
|
||||
@ -11191,6 +11192,19 @@ void ImGui::NavMoveRequestResolveWithLastItem(ImGuiNavItemData* result)
|
||||
NavUpdateAnyRequestFlag();
|
||||
}
|
||||
|
||||
// Called by TreePop() to implement ImGuiTreeNodeFlags_NavLeftJumpsBackHere
|
||||
void ImGui::NavMoveRequestResolveWithPastTreeNode(ImGuiNavItemData* result, ImGuiNavTreeNodeData* tree_node_data)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
g.NavMoveScoringItems = false;
|
||||
g.LastItemData.ID = tree_node_data->ID;
|
||||
g.LastItemData.InFlags = tree_node_data->InFlags;
|
||||
g.LastItemData.NavRect = tree_node_data->NavRect;
|
||||
NavApplyItemToResult(result); // Result this instead of implementing a NavApplyPastTreeNodeToResult()
|
||||
NavClearPreferredPosForAxis(ImGuiAxis_Y);
|
||||
NavUpdateAnyRequestFlag();
|
||||
}
|
||||
|
||||
void ImGui::NavMoveRequestCancel()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
|
Reference in New Issue
Block a user