Input
Pointer iconsNew
Show grab, move, wait, help and resize cursors with TaoPointerIcons and Modifier.pointerHoverIcon.
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
| Icon | Typical use |
|---|---|
Grab / Grabbing | Drag handle on hover / while dragging |
Move | An element that will move |
NotAllowed | A refused drop |
Wait | The app ignores input |
Progress | Busy, still interactive |
Help | Contextual help |
ResizeEastWest / ResizeNorthSouth | Splitters 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 AWT | 3.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
- Drag and drop: pair
GrabandNotAllowedwith a drop target. - Docking: splitters that use the resize cursors.
- Migrate from 2.x: every behavior change in 3.0.
Was this page helpful?
Edit on GitHub
Last updated on