cosmic-text
cosmic-text copied to clipboard
Hide cursor based on selection, preedit, or config
- Cursor is now hidden when there is a selection.
- Cursor is now hidden when there is an IME preedit that specifies that there should be no cursor.
- Added
Edit::set_cursor_hidden()to hide cursor manually, which can be used to implement cursor blinking, and to hide cursor when the input is unfocused or read only.
While I generally prefer "positive" boolean flags (e.g. set_cursor_visible() would generally be better), in this case the logic looks simpler when we use the hidden flag: cursor_hidden = has_selection || has_preedit_without_cursor || set_cursor_hidden.
Rebased onto main. Please take a look.