LibGfx+LibWeb+UI: Add OpenHand cursor for CSS grab property
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

This commit is contained in:
Louis Dalibard 2025-09-06 18:19:21 +02:00 committed by Jelle Raaijmakers
commit 660bcfa2cd
Notes: github-actions[bot] 2025-09-13 12:28:12 +00:00
4 changed files with 8 additions and 0 deletions

View file

@ -28,6 +28,7 @@ enum class StandardCursor {
ResizeRow,
Hand,
Help,
OpenHand,
Drag,
DragCopy,
Move,

View file

@ -108,6 +108,7 @@ static Gfx::Cursor resolve_cursor(Layout::NodeWithStyle const& layout_node, Vect
case CSS::CursorPredefined::Cell:
return Gfx::StandardCursor::Crosshair;
case CSS::CursorPredefined::Grab:
return Gfx::StandardCursor::OpenHand;
case CSS::CursorPredefined::Grabbing:
return Gfx::StandardCursor::Drag;
case CSS::CursorPredefined::Pointer:

View file

@ -417,6 +417,9 @@ static void copy_data_to_clipboard(StringView data, NSPasteboardType pasteboard_
// FIXME: AppKit does not have a corresponding cursor, so we should make one.
[[NSCursor arrowCursor] set];
break;
case Gfx::StandardCursor::OpenHand:
[[NSCursor openHandCursor] set];
break;
case Gfx::StandardCursor::Drag:
[[NSCursor closedHandCursor] set];
break;

View file

@ -680,6 +680,9 @@ void WebContentView::update_cursor(Gfx::Cursor cursor)
case Gfx::StandardCursor::Help:
setCursor(Qt::WhatsThisCursor);
break;
case Gfx::StandardCursor::OpenHand:
setCursor(Qt::OpenHandCursor);
break;
case Gfx::StandardCursor::Drag:
setCursor(Qt::ClosedHandCursor);
break;