Nucleus
Input

Pointer iconsNew

Show grab, move, wait, help and resize cursors with TaoPointerIcons and Modifier.pointerHoverIcon.

View as Markdown

TaoPointerIcons (dev.nucleusframework.window.tao, part of nucleus-application) adds the cursors Compose does not define in common code. Pass them to Modifier.pointerHoverIcon:

Modifier.pointerHoverIcon(if (dragging) TaoPointerIcons.Grabbing else TaoPointerIcons.Grab)

Compose's own PointerIcon.Default, Text, Hand and Crosshair keep working.

Available icons

IconTypical use
Grab / GrabbingDrag handle on hover / while dragging
MoveAn element that will move
NotAllowedA refused drop
WaitThe app ignores input
ProgressBusy, still interactive
HelpContextual help
ResizeEastWest / ResizeNorthSouthSplitters and window edges

Each icon uses the platform's own shape, or the arrow where the platform has none.

Replace AWT cursors

Changed in 3.0

PointerIcon(Cursor(...)) maps only the predefined AWT text, hand, crosshair, wait, move and resize types. Other AWT cursors, including Toolkit.createCustomCursor images, show the arrow.

2.x with AWT3.0
PointerIcon(Cursor(Cursor.MOVE_CURSOR))TaoPointerIcons.Move
PointerIcon(Cursor(Cursor.WAIT_CURSOR))TaoPointerIcons.Wait
PointerIcon(Cursor(Cursor.E_RESIZE_CURSOR))TaoPointerIcons.ResizeEastWest
PointerIcon(Cursor(Cursor.N_RESIZE_CURSOR))TaoPointerIcons.ResizeNorthSouth

What's next

Was this page helpful?
Edit on GitHub

Last updated on