Ticket #876 (closed enhancement: fixed)
[PATCH] Make CInput caret more visible
| Reported by: | kenny | Owned by: | kingadami |
|---|---|---|---|
| Priority: | Should Have | Milestone: | Alpha 13 |
| Component: | Core engine | Keywords: | patch |
| Cc: |
Description
Currently the caret (data entry point) for CInput is a small line that is drawn under the character position to the right of the current insert point. A flashing vertical line would be ideal and is standard practice. At a minimum we need to thicken up the line or do something to make it more visible.
This becomes more important as we start to use CInput for things like in game messaging. The blinking cursor would provide an indication that the input area is active and make it clear where you are in the text box.
Attachments
Change History
Changed 6 months ago by kingadami
- Attachment 0adTicket_876.patch added
First pass at making the CInput cusor flashing. Also, made the console cursor flash as well for consistency
comment:3 Changed 6 months ago by kingadami
- Keywords patch review added
- Summary changed from Make CInput caret more visible to [PATCH] Make CInput caret more visible
- Milestone changed from Backlog to Alpha 13
Attached patch to make the CInput cursor flash. There are 2 new properties for the CInput control which can be set in the xml:
- enable_cursor_flash - Turns flashing on or off (default is set to true).
- cursor_flash_rate - The flashing time specified in seconds (default is set to 0.5 seconds).
I also implemented cursor flashing in the Console for consistency. The Console seems to be implemented a little cleaner than CInput, but it is simpler as well.
Let me know if you have any questions or comments.
Thanks.
comment:4 Changed 6 months ago by historic_bruno
Thanks for the patch. It seems to work well, but I'm not convinced that we want a per-object setting. Maybe a global config setting to adjust cursor blink rate (0.0 to disable)? See CFG_GET_VAL().
Changed 6 months ago by kingadami
- Attachment 0adTicket_876_2.patch added
Second pass at blinking the cursor
comment:5 Changed 6 months ago by kingadami
Added 0adTicket_876_2.patch which makes the cursor blink rate a global instead of a per-object setting (using historic_bruno's comments). The 2 new xml properties for CInput were removed and a global config option "gui.cursorblinkrate" was added to the default configuration file. Both CInput and CConsole use this setting. Setting this value to 0.0 disables blinking.
Let me know what you think.
Thanks.
comment:6 Changed 5 months ago by ben
- Status changed from assigned to closed
- Resolution set to fixed
In 13068:
comment:7 follow-up: ↓ 8 Changed 5 months ago by historic_bruno
- Keywords review removed
I made a few minor alterations to your patch, the most important is that a newly focused input control should always have visible cursor, regardless of the timing involved. My solution was a bit of a hack, but it works :)
One other bug I noticed but didn't fix: the cursor behavior is slightly non-standard, it shouldn't blink while the cursor is being moved. Personally I don't mind this either way and I have no idea how hard it would be to fix.
comment:8 in reply to: ↑ 7 Changed 5 months ago by kingadami
Replying to historic_bruno:
I made a few minor alterations to your patch, the most important is that a newly focused input control should always have visible cursor, regardless of the timing involved. My solution was a bit of a hack, but it works :)
One other bug I noticed but didn't fix: the cursor behavior is slightly non-standard, it shouldn't blink while the cursor is being moved. Personally I don't mind this either way and I have no idea how hard it would be to fix.
I agree with your statement that it should not flash while being moved. The CInput control should be relativly easy to chang I think. I will probably open up another ticket and make that change as well in the next week.
