|
|
@ -604,13 +604,12 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool |
|
|
|
bool nav_activated_by_code = (g.NavActivateId == id); |
|
|
|
bool nav_activated_by_code = (g.NavActivateId == id); |
|
|
|
bool nav_activated_by_inputs = IsNavInputTest(ImGuiNavInput_Activate, (flags & ImGuiButtonFlags_Repeat) ? ImGuiInputReadMode_Repeat : ImGuiInputReadMode_Pressed); |
|
|
|
bool nav_activated_by_inputs = IsNavInputTest(ImGuiNavInput_Activate, (flags & ImGuiButtonFlags_Repeat) ? ImGuiInputReadMode_Repeat : ImGuiInputReadMode_Pressed); |
|
|
|
if (nav_activated_by_code || nav_activated_by_inputs) |
|
|
|
if (nav_activated_by_code || nav_activated_by_inputs) |
|
|
|
pressed = true; |
|
|
|
|
|
|
|
if (nav_activated_by_code || nav_activated_by_inputs || g.ActiveId == id) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
// Set active id so it can be queried by user via IsItemActive(), equivalent of holding the mouse button.
|
|
|
|
// 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
|
|
|
|
pressed = true; |
|
|
|
SetActiveID(id, window); |
|
|
|
SetActiveID(id, window); |
|
|
|
if ((nav_activated_by_code || nav_activated_by_inputs) && !(flags & ImGuiButtonFlags_NoNavFocus)) |
|
|
|
g.ActiveIdSource = ImGuiInputSource_Nav; |
|
|
|
|
|
|
|
if (!(flags & ImGuiButtonFlags_NoNavFocus)) |
|
|
|
SetFocusID(id, window); |
|
|
|
SetFocusID(id, window); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|