|
|
|
@ -7048,10 +7048,7 @@ ImGuiMultiSelectIO* ImGui::BeginMultiSelect(ImGuiMultiSelectFlags flags) |
|
|
|
|
ms->BeginIO.NavIdItem = ms->EndIO.NavIdItem = storage->NavIdItem; |
|
|
|
|
ms->BeginIO.NavIdSelected = ms->EndIO.NavIdSelected = (storage->NavIdSelected == 1) ? true : false; |
|
|
|
|
|
|
|
|
|
if (!ms->IsFocused) |
|
|
|
|
return &ms->BeginIO; // This is cleared at this point.
|
|
|
|
|
|
|
|
|
|
// Auto clear when using Navigation to move within the selection
|
|
|
|
|
// Clear when using Navigation to move within the scope
|
|
|
|
|
// (we compare FocusScopeId so it possible to use multiple selections inside a same window)
|
|
|
|
|
if (g.NavJustMovedToId != 0 && g.NavJustMovedToFocusScopeId == ms->FocusScopeId && g.NavJustMovedToHasSelectionData) |
|
|
|
|
{ |
|
|
|
@ -7062,7 +7059,15 @@ ImGuiMultiSelectIO* ImGui::BeginMultiSelect(ImGuiMultiSelectFlags flags) |
|
|
|
|
if ((ms->KeyMods & (ImGuiMod_Ctrl | ImGuiMod_Shift)) == 0) |
|
|
|
|
ms->BeginIO.RequestClear = true; |
|
|
|
|
} |
|
|
|
|
else if (g.NavJustMovedFromFocusScopeId == ms->FocusScopeId) |
|
|
|
|
{ |
|
|
|
|
// Also clear on leaving scope (may be optional?)
|
|
|
|
|
if ((ms->KeyMods & (ImGuiMod_Ctrl | ImGuiMod_Shift)) == 0) |
|
|
|
|
ms->BeginIO.RequestClear = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (ms->IsFocused) |
|
|
|
|
{ |
|
|
|
|
// Shortcut: Select all (CTRL+A)
|
|
|
|
|
if (!(flags & ImGuiMultiSelectFlags_SingleSelect) && !(flags & ImGuiMultiSelectFlags_NoSelectAll)) |
|
|
|
|
if (Shortcut(ImGuiMod_Ctrl | ImGuiKey_A)) |
|
|
|
@ -7074,6 +7079,7 @@ ImGuiMultiSelectIO* ImGui::BeginMultiSelect(ImGuiMultiSelectFlags flags) |
|
|
|
|
if (flags & ImGuiMultiSelectFlags_ClearOnEscape) |
|
|
|
|
if (Shortcut(ImGuiKey_Escape)) |
|
|
|
|
ms->BeginIO.RequestClear = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (g.DebugLogFlags & ImGuiDebugLogFlags_EventSelection) |
|
|
|
|
DebugLogMultiSelectRequests("BeginMultiSelect", &ms->BeginIO); |
|
|
|
|