racket / gui

Other
63 stars 78 forks source link

Accessibility: improve support for caret configuration #206

Open LiberalArtist opened 3 years ago

LiberalArtist commented 3 years ago

This issue was first reported on the mailing list: some people find a blinking caret either an annoyance or an accessibility issue.

Robby’s https://github.com/racket/gui/commit/1c4e78efc43036aabf77a7a1a313f19e23131b7e was a first step toward addressing this by creating a preference ('framework:caret-blink-disable?) to turn blinking off.

As noted, it would be nice to look at the system-level preference when available. The issue https://github.com/electron/electron/issues/10668 seems to have some useful notes.

Beyond disabling blinking, it looks like all platforms support configuring the speed of caret blinking, and Windows and GTK seem to make the width and color of the caret configurable as well. Probably Racket should, too.

rfindler commented 3 years ago

Since the code that actually does the drawing, etc., isn't in the framework, but is in wxme, the changes would have to be there for those parts.

LiberalArtist commented 3 years ago

I haven't had a chance to test https://github.com/racket/gui/commit/1c4e78efc43036aabf77a7a1a313f19e23131b7e yet, but IIUC making the change at the level of text:basic-mixin wouldn't affect, for example, text-field%. I haven't personally wanted to configure things this way, but it seems like users who want non-blinking want it in fields, too.

rfindler commented 3 years ago

Yes, that's true. I put it in the framework because the preferences are accessible there. But you're right, it is better at the text% level.

rfindler commented 3 years ago

Probably I should take it out before the release because of this!

loafofpiecrust commented 3 years ago

I'm not sure if this fits here, but I would love to be able to configure the type of caret used in an editor. In emacs, for example, the caret can be one of these types '(box underline hollow line). The most flexible option might be a method for caret drawing that I can override. GTK doesn't seem to support such a thing directly, but if it's possible that would be fantastic. I've been digging around a bit in the wxme code to figure this out, but there are virtually no comments in any of the code, making it very difficult to decipher.

rfindler commented 3 years ago

@loafofpiecrust the editor is actually implemented completely at the Racket level, not using gtk's (or other platform's) editors. Changing the drawing of the insertion caret might be challenging as it is one of the parts of the text% that's got performance concerns currently.

LiberalArtist commented 3 months ago

I'm not sure if this fits here, but I would love to be able to configure the type of caret used in an editor.

Related: https://github.com/racket/drracket/issues/667