mirror of
https://github.com/ocornut/imgui.git
synced 2025-10-21 09:21:59 +00:00
MultiSelect: clear selection when leaving a scope with a nav directional request.
May need to clarify how to depends on actions being performed (e.g. click doesn't). May become optional?
This commit is contained in:
@@ -12251,6 +12251,7 @@ static void ImGui::NavUpdate()
|
||||
|
||||
// Process navigation init request (select first/default focus)
|
||||
g.NavJustMovedToId = 0;
|
||||
g.NavJustMovedToFocusScopeId = g.NavJustMovedFromFocusScopeId = 0;
|
||||
if (g.NavInitResult.ID != 0)
|
||||
NavInitRequestApplyResult();
|
||||
g.NavInitRequest = false;
|
||||
@@ -12403,6 +12404,7 @@ void ImGui::NavInitRequestApplyResult()
|
||||
ImGuiNavItemData* result = &g.NavInitResult;
|
||||
if (g.NavId != result->ID)
|
||||
{
|
||||
g.NavJustMovedFromFocusScopeId = g.NavFocusScopeId;
|
||||
g.NavJustMovedToId = result->ID;
|
||||
g.NavJustMovedToFocusScopeId = result->FocusScopeId;
|
||||
g.NavJustMovedToKeyMods = 0;
|
||||
@@ -12661,6 +12663,7 @@ void ImGui::NavMoveRequestApplyResult()
|
||||
// PageUp/PageDown however sets always set NavJustMovedTo (vs Home/End which doesn't) mimicking Windows behavior.
|
||||
if ((g.NavId != result->ID || (g.NavMoveFlags & ImGuiNavMoveFlags_IsPageMove)) && (g.NavMoveFlags & ImGuiNavMoveFlags_NoSelect) == 0)
|
||||
{
|
||||
g.NavJustMovedFromFocusScopeId = g.NavFocusScopeId;
|
||||
g.NavJustMovedToId = result->ID;
|
||||
g.NavJustMovedToFocusScopeId = result->FocusScopeId;
|
||||
g.NavJustMovedToKeyMods = g.NavMoveKeyMods;
|
||||
|
Reference in New Issue
Block a user