RangeSelect/MultiSelect: Transition to use FocusScope bits merged in master.

Preserve ability to shift+arrow into an item that is part of FocusScope but doesn't carry a selection without breaking selection.
This commit is contained in:
omar
2020-01-13 15:05:53 +01:00
committed by ocornut
parent abfa8487eb
commit dd52a2854c
3 changed files with 49 additions and 31 deletions

View File

@ -4554,7 +4554,6 @@ void ImGui::Shutdown(ImGuiContext* context)
g.ClipboardHandlerData.clear();
g.MenusIdSubmittedThisFrame.clear();
g.InputTextState.ClearFreeMemory();
g.MultiSelectScopeWindow = NULL;
g.SettingsWindows.clear();
g.SettingsHandlers.clear();
@ -9735,6 +9734,7 @@ static void ImGui::NavApplyItemToResult(ImGuiNavItemData* result)
result->FocusScopeId = window->DC.NavFocusScopeIdCurrent;
result->InFlags = g.LastItemData.InFlags;
result->RectRel = WindowRectAbsToRel(window, g.LastItemData.NavRect);
result->HasSelectionData = (g.NextItemData.Flags & ImGuiNextItemDataFlags_HasSelectionData) != 0; // FIXME: Bizarre but valid we are calling NavApplyItemToResult() before clering the NextItemData
}
// We get there when either NavId == id, or when g.NavAnyRequest is set (which is updated by NavUpdateAnyRequestFlag above)
@ -10491,6 +10491,7 @@ void ImGui::NavMoveRequestApplyResult()
g.NavJustMovedToId = result->ID;
g.NavJustMovedToFocusScopeId = result->FocusScopeId;
g.NavJustMovedToKeyMods = g.NavMoveKeyMods;
g.NavJustMovedToHasSelectionData = result->HasSelectionData;
}
// Focus