I’ve been struggling with this quite a bit. Initially, I assumed I could simply call something on the button itself to change the behavior to fire not on button release, but on button press, but I didn’t find a way to do that.
button("Tap").on_press(Message::Tap).into(),
I’m assuming I need to create some sort of custom widget with a custom configuration, but I can’t seem to figure it out.
I needed to do the same thing for a button press, have it fire on key press and not key release, and that seemed pretty straight forward with:
Hmm, would there be a way to create a custom widget that overlays a button with a mouse area? I’m not quite sure the best way to implement this behavior in a way that is has good UX when interacting with the widget.
You can just put any kind of widget in a mouse area. Although I would not put a button inside of it but a container with a label and style is accordingly to the status.