mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-07 04:30:08 +00:00
Nav: Fixed an keyboard issue where holding Activate/Space for longer than two frames on a button would unnecessary keep the focus on the parent window, which could steal it from newly appearing windows. (#787)
This commit is contained in:
parent
d223d1e951
commit
9ba202821f
4 changed files with 5 additions and 2 deletions
|
|
@ -488,7 +488,7 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
|
|||
// Set active id so it can be queried by user via IsItemActive(), equivalent of holding the mouse button.
|
||||
g.NavActivateId = id; // This is so SetActiveId assign a Nav source
|
||||
SetActiveID(id, window);
|
||||
if (!(flags & ImGuiButtonFlags_NoNavFocus))
|
||||
if ((nav_activated_by_code || nav_activated_by_inputs) && !(flags & ImGuiButtonFlags_NoNavFocus))
|
||||
SetFocusID(id, window);
|
||||
g.ActiveIdAllowNavDirFlags = (1 << ImGuiDir_Left) | (1 << ImGuiDir_Right) | (1 << ImGuiDir_Up) | (1 << ImGuiDir_Down);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue