TextLink(), TextLinkOpenURL(): change mouse cursor to Hand shape when hovered. (#7885, #7660)

This commit is contained in:
ocornut 2024-08-13 14:30:16 +02:00
parent 45e7f7827a
commit 29fadad193
2 changed files with 4 additions and 0 deletions

View File

@ -47,6 +47,7 @@ Other changes:
payload over an already open tree node would incorrectly select it. (#7850) payload over an already open tree node would incorrectly select it. (#7850)
- MultiSelect+TreeNode: default open behavior is OpenOnDoubleClick + OpenOnArrow - MultiSelect+TreeNode: default open behavior is OpenOnDoubleClick + OpenOnArrow
when used in a multi-select context without any OpenOnXXX flags set. (#7850) when used in a multi-select context without any OpenOnXXX flags set. (#7850)
- TextLink(), TextLinkOpenURL(): change mouse cursor to Hand shape when hovered. (#7885, #7660)
- Backends: GLFW: added ImGui_ImplGlfw_Sleep() helper function because GLFW does not - Backends: GLFW: added ImGui_ImplGlfw_Sleep() helper function because GLFW does not
provide a way to do a portable sleep. (#7844) provide a way to do a portable sleep. (#7844)
- Examples: GLFW (all), SDL2 (all), SDL3 (all), Win32+OpenGL3: rework examples main loop - Examples: GLFW (all), SDL2 (all), SDL3 (all), Win32+OpenGL3: rework examples main loop

View File

@ -1425,6 +1425,9 @@ bool ImGui::TextLink(const char* label)
bool pressed = ButtonBehavior(bb, id, &hovered, &held); bool pressed = ButtonBehavior(bb, id, &hovered, &held);
RenderNavHighlight(bb, id, ImGuiNavHighlightFlags_None); RenderNavHighlight(bb, id, ImGuiNavHighlightFlags_None);
if (hovered)
SetMouseCursor(ImGuiMouseCursor_Hand);
ImVec4 text_colf = g.Style.Colors[ImGuiCol_TextLink]; ImVec4 text_colf = g.Style.Colors[ImGuiCol_TextLink];
ImVec4 line_colf = text_colf; ImVec4 line_colf = text_colf;
{ {