mirror of
https://github.com/ocornut/imgui.git
synced 2025-10-16 06:55:59 +00:00
Shortcuts: added support for combining ImGuiInputFlags_RouteFocused with ImGuiInputFlags_RouteOverActive,. (#9004)
This commit is contained in:
11
imgui.cpp
11
imgui.cpp
@@ -9477,7 +9477,12 @@ static int CalcRoutingScore(ImGuiID focus_scope_id, ImGuiID owner_id, ImGuiInput
|
||||
return 0;
|
||||
for (int index_in_focus_path = 0; index_in_focus_path < g.NavFocusRoute.Size; index_in_focus_path++)
|
||||
if (g.NavFocusRoute.Data[index_in_focus_path].ID == focus_scope_id)
|
||||
return 199 - index_in_focus_path;
|
||||
{
|
||||
if (flags & ImGuiInputFlags_RouteOverActive) // && g.ActiveId != 0 && g.ActiveId != owner_id)
|
||||
return 599 - index_in_focus_path;
|
||||
else
|
||||
return 199 - index_in_focus_path;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
else if (flags & ImGuiInputFlags_RouteActive)
|
||||
@@ -9534,8 +9539,10 @@ bool ImGui::SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiInputFlags flags, I
|
||||
else
|
||||
IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiInputFlags_RouteTypeMask_)); // Check that only 1 routing flag is used
|
||||
IM_ASSERT(owner_id != ImGuiKeyOwner_Any && owner_id != ImGuiKeyOwner_NoOwner);
|
||||
if (flags & (ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteOverActive | ImGuiInputFlags_RouteUnlessBgFocused))
|
||||
if (flags & (ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteUnlessBgFocused))
|
||||
IM_ASSERT(flags & ImGuiInputFlags_RouteGlobal);
|
||||
if (flags & ImGuiInputFlags_RouteOverActive)
|
||||
IM_ASSERT(flags & (ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteFocused));
|
||||
|
||||
// Add ImGuiMod_XXXX when a corresponding ImGuiKey_LeftXXX/ImGuiKey_RightXXX is specified.
|
||||
key_chord = FixupKeyChord(key_chord);
|
||||
|
Reference in New Issue
Block a user