mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
Internals: Tracking dummy select scope id (currently always zero) to facilitate merging of the range_select branch. (#1861)
This commit is contained in:
parent
d5945aa25b
commit
5cb7040f66
@ -7321,6 +7321,7 @@ static void ImGui::NavProcessItem(ImGuiWindow* window, const ImRect& nav_bb, con
|
||||
if (new_best)
|
||||
{
|
||||
result->ID = id;
|
||||
result->SelectScopeId = g.MultiSelectScopeId;
|
||||
result->Window = window;
|
||||
result->RectRel = nav_bb_rel;
|
||||
}
|
||||
@ -7332,6 +7333,7 @@ static void ImGui::NavProcessItem(ImGuiWindow* window, const ImRect& nav_bb, con
|
||||
{
|
||||
result = &g.NavMoveResultLocalVisibleSet;
|
||||
result->ID = id;
|
||||
result->SelectScopeId = g.MultiSelectScopeId;
|
||||
result->Window = window;
|
||||
result->RectRel = nav_bb_rel;
|
||||
}
|
||||
@ -7872,8 +7874,13 @@ static void ImGui::NavUpdateMoveResult()
|
||||
|
||||
ClearActiveID();
|
||||
g.NavWindow = result->Window;
|
||||
SetNavIDWithRectRel(result->ID, g.NavLayer, result->RectRel);
|
||||
if (g.NavId != result->ID)
|
||||
{
|
||||
// Don't set NavJustMovedToId if just landed on the same spot (which may happen with ImGuiNavMoveFlags_AllowCurrentNavId)
|
||||
g.NavJustMovedToId = result->ID;
|
||||
g.NavJustMovedToSelectScopeId = result->SelectScopeId;
|
||||
}
|
||||
SetNavIDWithRectRel(result->ID, g.NavLayer, result->RectRel);
|
||||
g.NavMoveFromClampedRefRect = false;
|
||||
}
|
||||
|
||||
|
@ -691,6 +691,7 @@ struct ImDrawDataBuilder
|
||||
struct ImGuiNavMoveResult
|
||||
{
|
||||
ImGuiID ID; // Best candidate
|
||||
ImGuiID SelectScopeId;// Best candidate window current selectable group ID
|
||||
ImGuiWindow* Window; // Best candidate window
|
||||
float DistBox; // Best candidate box distance to current NavId
|
||||
float DistCenter; // Best candidate center distance to current NavId
|
||||
@ -698,7 +699,7 @@ struct ImGuiNavMoveResult
|
||||
ImRect RectRel; // Best candidate bounding box in window relative space
|
||||
|
||||
ImGuiNavMoveResult() { Clear(); }
|
||||
void Clear() { ID = 0; Window = NULL; DistBox = DistCenter = DistAxial = FLT_MAX; RectRel = ImRect(); }
|
||||
void Clear() { ID = SelectScopeId = 0; Window = NULL; DistBox = DistCenter = DistAxial = FLT_MAX; RectRel = ImRect(); }
|
||||
};
|
||||
|
||||
// Storage for SetNexWindow** functions
|
||||
@ -823,8 +824,9 @@ struct ImGuiContext
|
||||
ImGuiID NavActivatePressedId; // ~~ IsNavInputPressed(ImGuiNavInput_Activate) ? NavId : 0
|
||||
ImGuiID NavInputId; // ~~ IsNavInputPressed(ImGuiNavInput_Input) ? NavId : 0
|
||||
ImGuiID NavJustTabbedId; // Just tabbed to this id.
|
||||
ImGuiID NavJustMovedToId; // Just navigated to this id (result of a successfully MoveRequest)
|
||||
ImGuiID NavNextActivateId; // Set by ActivateItem(), queued until next frame
|
||||
ImGuiID NavJustMovedToId; // Just navigated to this id (result of a successfully MoveRequest).
|
||||
ImGuiID NavJustMovedToSelectScopeId; // Just navigated to this select scope id (result of a successfully MoveRequest).
|
||||
ImGuiID NavNextActivateId; // Set by ActivateItem(), queued until next frame.
|
||||
ImGuiInputSource NavInputSource; // Keyboard or Gamepad mode? THIS WILL ONLY BE None or NavGamepad or NavKeyboard.
|
||||
ImRect NavScoringRectScreen; // Rectangle used for scoring, in screen space. Based of window->DC.NavRefRectRel[], modified for directional navigation scoring.
|
||||
int NavScoringCount; // Metrics for debugging
|
||||
@ -897,6 +899,10 @@ struct ImGuiContext
|
||||
int TooltipOverrideCount;
|
||||
ImVector<char> PrivateClipboard; // If no custom clipboard handler is defined
|
||||
|
||||
// Range-Select/Multi-Select
|
||||
// [This is unused in this branch, but left here to facilitate merging/syncing multiple branches]
|
||||
ImGuiID MultiSelectScopeId;
|
||||
|
||||
// Platform support
|
||||
ImVec2 PlatformImePos; // Cursor position request & last passed to the OS Input Method Editor
|
||||
ImVec2 PlatformImeLastPos;
|
||||
@ -968,7 +974,7 @@ struct ImGuiContext
|
||||
|
||||
NavWindow = NULL;
|
||||
NavId = NavActivateId = NavActivateDownId = NavActivatePressedId = NavInputId = 0;
|
||||
NavJustTabbedId = NavJustMovedToId = NavNextActivateId = 0;
|
||||
NavJustTabbedId = NavJustMovedToId = NavJustMovedToSelectScopeId = NavNextActivateId = 0;
|
||||
NavInputSource = ImGuiInputSource_None;
|
||||
NavScoringRectScreen = ImRect();
|
||||
NavScoringCount = 0;
|
||||
@ -1014,6 +1020,9 @@ struct ImGuiContext
|
||||
DragSpeedDefaultRatio = 1.0f / 100.0f;
|
||||
ScrollbarClickDeltaToGrabCenter = ImVec2(0.0f, 0.0f);
|
||||
TooltipOverrideCount = 0;
|
||||
|
||||
MultiSelectScopeId = 0;
|
||||
|
||||
PlatformImePos = PlatformImeLastPos = ImVec2(FLT_MAX, FLT_MAX);
|
||||
|
||||
SettingsLoaded = false;
|
||||
|
Loading…
Reference in New Issue
Block a user