core icon indicating copy to clipboard operation
core copied to clipboard

More cursor features

Open kkoreilly opened this issue 1 year ago • 3 comments

Describe the feature

#1372 gets cursors in a pretty good place overall, but there are still some less urgent features we can add at some point:

  • A user setting to control cursor size, which could be helpful for accessibility
  • Support for animated cursors, which is needed for Progress and Wait to work correctly
  • Fix the Cannot process svg element mask error to make the progress cursor render correctly
  • Potentially use our custom cursor rendering on web instead of the default cursors; it would be nice to have cursors be consistent across all platforms for Cogent Core, although it would come at a nonzero performance cost, and consistency with other websites may be more important on the web

Relevant code

No response

kkoreilly avatar Dec 15 '24 04:12 kkoreilly

It would also be nice to be able to disable the cursor entirely in some cases.

DapperMongoose avatar Dec 15 '24 04:12 DapperMongoose

Yes, we have a SetCursorEnabled function on system.Window that you can use to disable the cursor and also to enable raw mouse motion. We will probably add a nicer API for that to the core.Scene soon, in addition to documenting that functionality and implementing it on web.

kkoreilly avatar Dec 15 '24 05:12 kkoreilly

The other issue is that macOS automatically rescales the cursor image we pass it on Retina displays to be twice as large (rescaled by DevicePixelRatio), thereby making it look somewhat blurry. We want to just pass it the larger image from the start, but then it makes that twice as large, making the cursor too big and still blurry. I made some key fixes in 092c9017046321ae0a6c36b175e60000a9db319a that make the cursors look much less blurry on Retina displays, so it isn't a major issue, but it would be nice to fix if possible; my initial research didn't find any answers in glfw. As such, we might fix that if/when we fold glfw into Cogent Core.

kkoreilly avatar Dec 15 '24 21:12 kkoreilly