bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Improve window cursor usability

Open lewiszlw opened this issue 1 year ago • 3 comments

Objective

  • Let user can use pattern like below when creating window
...
cursor: Cursor {
    hit_test: true,
    ..default()
},
...
  • make hit_test default false

lewiszlw avatar Mar 08 '23 07:03 lewiszlw

The physical_position field was deliberately made private in #7297. This seems like a regression there.

james7132 avatar Mar 08 '23 07:03 james7132

If not set physical_position field public, users can't create Cursor by themselves. I thought CursorBuilder will be a bit heavy, but the solution depends on you.

lewiszlw avatar Mar 08 '23 08:03 lewiszlw

Maybe we can add comment to warn users not modify physical_position field directly.

lewiszlw avatar Mar 08 '23 08:03 lewiszlw

I think we should add a Cursor::new(grab_mode, visible, hit_test, icon) method, currently if someone wants to modify the cursor of a window they have to construct it with Cursor::default() and then modify the field they want to change.

Example of someone experiencing this issue. https://discord.com/channels/691052431525675048/1083143550738386984

LiamGallagher737 avatar Mar 08 '23 22:03 LiamGallagher737

Closing in favor of https://github.com/bevyengine/bevy/pull/7988.

lewiszlw avatar Mar 09 '23 03:03 lewiszlw