mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
InputText: ensure mouse cursor is set regardless of whether keyboard mode is enabled or not. (#6417)
+ Nav comments (#8059)
This commit is contained in:
parent
20ae8bd4c3
commit
349af8766c
4 changed files with 12 additions and 2 deletions
|
|
@ -4462,9 +4462,13 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
|||
if (!ItemAdd(total_bb, id, &frame_bb, ImGuiItemFlags_Inputable))
|
||||
return false;
|
||||
}
|
||||
const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.InFlags);
|
||||
|
||||
// Ensure mouse cursor is set even after switching to keyboard/gamepad mode. May generalize further? (#6417)
|
||||
bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.InFlags | ImGuiItemFlags_NoNavDisableMouseHover);
|
||||
if (hovered)
|
||||
SetMouseCursor(ImGuiMouseCursor_TextInput);
|
||||
if (hovered && g.NavDisableMouseHover)
|
||||
hovered = false;
|
||||
|
||||
// We are only allowed to access the state if we are already the active widget.
|
||||
ImGuiInputTextState* state = GetInputTextState(id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue