Styleable mouse cursor for buttons?

Currently, in iced the default cursor for a clickable button is a pointer. On most platforms, native applications keep the default cursor and indicate the possible interaction using visual styles. Only for text-links where there is little visual indication [that it can be clicked] the pointer cursor is used.

Would it make sense to allow the cursor type for the button to be specified by the button::Style?

That would allow to use default cursor for button-like buttons (primary, secondary, danger) and pointer for text-like buttons. And give the users the chance to specify other cursor types depending on the context of the button.

Currently MouseArea can do that. MouseArea in iced::widget - Rust

In what use cases would the button cursor not be the default? You mentioned text-like buttons but I am not sure what you mean.

Ahh, nice, hadn’t noticed the existence of MouseArea.


But in general, I mean that usually buttons don’t have a pointer cursor, only visual indications. Some examples from my browser:


image

The pointer cursor is usually only for text “buttons” (i.e. button::text):
image

That’s why I think it would make sense to make the cursor-choice part of the button::Style.

Both examples that you share have the same cursor. Could you give an example of a button that has another cursor?

There’s a 3rd screenshot there that blends in a bit too well :angel: here’s a bigger version of that: