Skip to content

Commit

Permalink
When requesting a Help cursor on a backend other than SFML (which is …
Browse files Browse the repository at this point in the history
…the only backend that supports it), the Hand cursor is now shown instead of keeping the old cursor
  • Loading branch information
texus committed Sep 1, 2024
1 parent bc104de commit 0167e73
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
8 changes: 2 additions & 6 deletions src/Backend/Window/GLFW/BackendGLFW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ namespace tgui
case Cursor::Type::Text:
typeGLFW = GLFW_IBEAM_CURSOR;
break;
case Cursor::Type::Help: // BackendGLFW doesn't support Cursor::Type::Help
case Cursor::Type::Hand:
typeGLFW = GLFW_POINTING_HAND_CURSOR;
break;
Expand All @@ -199,9 +200,6 @@ namespace tgui
case Cursor::Type::Crosshair:
typeGLFW = GLFW_CROSSHAIR_CURSOR;
break;
case Cursor::Type::Help:
TGUI_PRINT_WARNING("BackendGLFW doesn't support Cursor::Type::Help");
break;
case Cursor::Type::NotAllowed:
typeGLFW = GLFW_NOT_ALLOWED_CURSOR;
break;
Expand All @@ -219,6 +217,7 @@ namespace tgui
case Cursor::Type::Text:
typeGLFW = GLFW_IBEAM_CURSOR;
break;
case Cursor::Type::Help: // BackendGLFW doesn't support Cursor::Type::Help
case Cursor::Type::Hand:
typeGLFW = GLFW_HAND_CURSOR;
break;
Expand All @@ -235,9 +234,6 @@ namespace tgui
case Cursor::Type::Crosshair:
typeGLFW = GLFW_CROSSHAIR_CURSOR;
break;
case Cursor::Type::Help: // In release mode, Help and NotAllowed branches are identical. NOLINT(bugprone-branch-clone)
TGUI_PRINT_WARNING("BackendGLFW doesn't support Cursor::Type::Help");
break;
case Cursor::Type::NotAllowed:
TGUI_PRINT_WARNING("BackendGLFW doesn't support Cursor::Type::NotAllowed with GLFW < 3.4");
break;
Expand Down
4 changes: 1 addition & 3 deletions src/Backend/Window/Raylib/BackendRaylib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ namespace tgui
case Cursor::Type::Text:
typeRaylib = MOUSE_CURSOR_IBEAM;
break;
case Cursor::Type::Help: // BackendRaylib doesn't support Cursor::Type::Help
case Cursor::Type::Hand:
typeRaylib = MOUSE_CURSOR_POINTING_HAND;
break;
Expand All @@ -79,9 +80,6 @@ namespace tgui
case Cursor::Type::Crosshair:
typeRaylib = MOUSE_CURSOR_CROSSHAIR;
break;
case Cursor::Type::Help:
TGUI_PRINT_WARNING("BackendRaylib doesn't support Cursor::Type::Help");
break;
case Cursor::Type::NotAllowed:
typeRaylib = MOUSE_CURSOR_NOT_ALLOWED;
break;
Expand Down
8 changes: 2 additions & 6 deletions src/Backend/Window/SDL/BackendSDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ namespace tgui
case Cursor::Type::Text:
typeSDL = SDL_SYSTEM_CURSOR_TEXT;
break;
case Cursor::Type::Help: // BackendSDL doesn't support Cursor::Type::Help
case Cursor::Type::Hand:
typeSDL = SDL_SYSTEM_CURSOR_POINTER;
break;
Expand Down Expand Up @@ -359,9 +360,6 @@ namespace tgui
case Cursor::Type::Crosshair:
typeSDL = SDL_SYSTEM_CURSOR_CROSSHAIR;
break;
case Cursor::Type::Help:
TGUI_PRINT_WARNING("BackendSDL doesn't support Cursor::Type::Help");
break;
case Cursor::Type::NotAllowed:
typeSDL = SDL_SYSTEM_CURSOR_NOT_ALLOWED;
break;
Expand All @@ -376,6 +374,7 @@ namespace tgui
case Cursor::Type::Text:
typeSDL = SDL_SYSTEM_CURSOR_IBEAM;
break;
case Cursor::Type::Help: // BackendSDL doesn't support Cursor::Type::Help
case Cursor::Type::Hand:
typeSDL = SDL_SYSTEM_CURSOR_HAND;
break;
Expand All @@ -400,9 +399,6 @@ namespace tgui
case Cursor::Type::Crosshair:
typeSDL = SDL_SYSTEM_CURSOR_CROSSHAIR;
break;
case Cursor::Type::Help:
TGUI_PRINT_WARNING("BackendSDL doesn't support Cursor::Type::Help");
break;
case Cursor::Type::NotAllowed:
typeSDL = SDL_SYSTEM_CURSOR_NO;
break;
Expand Down

0 comments on commit 0167e73

Please sign in to comment.