mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 04:58:47 +02:00
Moved !IsActiveIdUsingKey(ImGuiKey_Tab) check to UpdateTabFocus(). Added asserts to IsItemHovered() and IsWindowHovered().
This commit is contained in:
@ -3199,7 +3199,7 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
|
||||
ImGuiItemStatusFlags status_flags = g.LastItemData.StatusFlags;
|
||||
if (!(status_flags & ImGuiItemStatusFlags_HoveredRect))
|
||||
return false;
|
||||
IM_ASSERT((flags & (ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows)) == 0); // Flags not supported by this function
|
||||
IM_ASSERT((flags & (ImGuiHoveredFlags_AnyWindow | ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_NoPopupHierarchy)) == 0); // Flags not supported by this function
|
||||
|
||||
// Test if we are hovering the right window (our window could be behind another window)
|
||||
// [2021/03/02] Reworked / reverted the revert, finally. Note we want e.g. BeginGroup/ItemAdd/EndGroup to work as well. (#3851)
|
||||
@ -3317,7 +3317,7 @@ void ImGui::ItemInputable(ImGuiWindow* window, ImGuiID id)
|
||||
|
||||
// Process TAB/Shift-TAB to tab *OUT* of the currently focused item.
|
||||
// (Note that we can always TAB out of a widget that doesn't allow tabbing in)
|
||||
if (g.ActiveId == id && g.TabFocusPressed && !IsActiveIdUsingKey(ImGuiKey_Tab) && g.TabFocusRequestNextWindow == NULL)
|
||||
if (g.ActiveId == id && g.TabFocusPressed && g.TabFocusRequestNextWindow == NULL)
|
||||
{
|
||||
g.TabFocusRequestNextWindow = window;
|
||||
g.TabFocusRequestNextCounterTabStop = window->DC.FocusCounterTabStop + (g.IO.KeyShift ? (is_tab_stop ? -1 : 0) : +1); // Modulo on index will be applied at the end of frame once we've got the total counter of items.
|
||||
@ -3839,7 +3839,7 @@ void ImGui::UpdateTabFocus()
|
||||
ImGuiContext& g = *GImGui;
|
||||
|
||||
// Pressing TAB activate widget focus
|
||||
g.TabFocusPressed = (g.NavWindow && g.NavWindow->Active && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs) && !g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_Tab));
|
||||
g.TabFocusPressed = (g.NavWindow && g.NavWindow->Active && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs) && !g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_Tab) && !IsActiveIdUsingKey(ImGuiKey_Tab));
|
||||
if (g.ActiveId == 0 && g.TabFocusPressed)
|
||||
{
|
||||
// - This path is only taken when no widget are active/tabbed-into yet.
|
||||
@ -6768,7 +6768,7 @@ bool ImGui::IsWindowAbove(ImGuiWindow* potential_above, ImGuiWindow* potential_b
|
||||
|
||||
bool ImGui::IsWindowHovered(ImGuiHoveredFlags flags)
|
||||
{
|
||||
IM_ASSERT((flags & ImGuiHoveredFlags_AllowWhenOverlapped) == 0); // Flags not supported by this function
|
||||
IM_ASSERT((flags & (ImGuiHoveredFlags_AllowWhenOverlapped | ImGuiHoveredFlags_AllowWhenDisabled)) == 0); // Flags not supported by this function
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiWindow* ref_window = g.HoveredWindow;
|
||||
ImGuiWindow* cur_window = g.CurrentWindow;
|
||||
|
Reference in New Issue
Block a user