UI: Blinking Text Cursors #116595

Open
Harley Acheson wants to merge 14 commits from Harley/blender:TextCursors into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

Blinking cursor while in an active area, dimmed cursor when not.


This PR tries to give a better indication of the text cursor (caret), especially when your mouse leaves the active area and therefore text input stops. Accidentally having your mouse move out of an area and therefore stop taking input is a common frustration.

image

Don't like blinking? Just turn it off in Preferences.

image

Afterward it won't blink, but will still dim when your mouse is out of the active area:

image

The blinking rate is 530 milliseconds, the default for Windows text carets. The blink state is set to "on" immediately on mouse selection and text cursor movement, otherwise it could feel like a delay in selection depending on where it was in the blink cycle.

Unlike every other application this is not turning the cursor off completely during the blink cycle but just lowers the opacity. This feels a lot nicer to me and looks like a single thing pulsing rather than something appearing and disappearing. It fills the space nicer when selecting, since we show the caret with text selections.

Blinking cursor while in an active area, dimmed cursor when not. --- This PR tries to give a better indication of the text cursor (caret), especially when your mouse leaves the active area and therefore text input stops. Accidentally having your mouse move out of an area and therefore stop taking input is a common frustration. ![image](/attachments/80f90f32-ef9b-4b2e-9db0-d7f35cc10366) Don't like blinking? Just turn it off in Preferences. ![image](/attachments/2fdc45dc-7b8c-4140-a1a3-6a35b8de992d) Afterward it won't blink, but will still _dim_ when your mouse is out of the active area: ![image](/attachments/b769942a-5497-4a75-a1f5-8cd0496c499d) The blinking rate is 530 milliseconds, the default for Windows text carets. The blink state is set to "on" immediately on mouse selection and text cursor movement, otherwise it could feel like a delay in selection depending on where it was in the blink cycle. Unlike every other application this is not turning the cursor off completely during the blink cycle but just lowers the opacity. This feels a lot nicer to me and looks like a single thing pulsing rather than something appearing and disappearing. It fills the space nicer when selecting, since we show the caret with text selections.
Harley Acheson added this to the User Interface project 2023-12-28 02:56:30 +01:00
Harley Acheson force-pushed TextCursors from 8622b55b98 to 6df570c508 2023-12-28 22:23:20 +01:00 Compare
Author
Member

@blender-bot build

@blender-bot build
Harley Acheson changed title from WIP: UI: Blinking Text Cursors to UI: Blinking Text Cursors 2023-12-30 18:33:42 +01:00
Harley Acheson requested review from Pablo Vazquez 2023-12-30 18:34:01 +01:00

Redrawing the region for this is too inefficient. The draw_overlay region callback exists for this purpose.

Also be sure to check that when the window goes out of focus or is minimized, the timer and redraws are stopped.

Redrawing the region for this is too inefficient. The `draw_overlay` region callback exists for this purpose. Also be sure to check that when the window goes out of focus or is minimized, the timer and redraws are stopped.
Author
Member

Redrawing the region for this is too inefficient. The draw_overlay region callback exists for this purpose.

Good point, will look into that.

Also be sure to check that when the window goes out of focus or is minimized, the timer and redraws are stopped.

Thanks

> Redrawing the region for this is too inefficient. The `draw_overlay` region callback exists for this purpose. Good point, will look into that. > Also be sure to check that when the window goes out of focus or is minimized, the timer and redraws are stopped. Thanks
Harley Acheson changed title from UI: Blinking Text Cursors to WIP: UI: Blinking Text Cursors 2024-01-04 01:31:26 +01:00
First-time contributor

Please make this purely optional (or not at all, preferably). I dislike flashing lights and ui elements.

Please make this purely optional (or not at all, preferably). I dislike flashing lights and ui elements.
Author
Member

Please make this purely optional (or not at all, preferably). I dislike flashing lights and ui elements.

Yes, don't worry about this yet. This is more a thing to look at and consider, weigh the benefits and advantages (if any). It is best evaluated by actually trying it - I can make you a build if you don't compile yourself. But yes, if this is something we really liked we'd probably need a make the flashing speed configurable, and so setting to 0 would turn off blinking.

> Please make this purely optional (or not at all, preferably). I dislike flashing lights and ui elements. Yes, don't worry about this yet. This is more a thing to look at and consider, weigh the benefits and advantages (if any). It is best evaluated by actually trying it - I can make you a build if you don't compile yourself. But yes, if this is something we really liked we'd probably need a make the flashing speed configurable, and so setting to 0 would turn off blinking.
Author
Member

@ThinkingPolygons - Sorry I deleted your comment by accident. Actually I tried just quoting it and replying and it somehow ended up with me editing your comment instead.

i also like how windows 10 does that. basically when activated it blinks 5 times and then stops. pretty neat.

What program in Windows 10, or what area? I don't think I've noticed any part of windows 10 or 11 or any program running in it having that behavior. Is this an option or in some particular place?

@ThinkingPolygons - Sorry I deleted your comment by accident. Actually I tried just quoting it and replying and it somehow ended up with me editing your comment instead. > > i also like how windows 10 does that. basically when activated it blinks 5 times and then stops. pretty neat. > > What program in Windows 10, or what area? I don't think I've noticed any part of windows 10 or 11 or any program running in it having that behavior. Is this an option or in some particular place?
First-time contributor

What program in Windows 10, or what area? I don't think I've noticed any part of windows 10 or 11 or any program running in it having that behavior. Is this an option or in some particular place?

@Harley its literally everywhere on windows 10

e.g notepad

explorer search

windows search

> What program in Windows 10, or what area? I don't think I've noticed any part of windows 10 or 11 or any program running in it having that behavior. Is this an option or in some particular place? @Harley its literally everywhere on windows 10 e.g notepad ![](https://cdn.discordapp.com/attachments/587761956526751784/1192720968846676008/notepad_PISW6QsoGY.gif) explorer search ![](https://cdn.discordapp.com/attachments/587761956526751784/1192720968423047228/explorer_PAwQjh5fNz.gif) windows search ![](https://cdn.discordapp.com/attachments/587761956526751784/1192720967898763264/d5OAguTjt0.gif)
Author
Member

@ThinkingPolygons

Hey, thanks for the examples! Weird that it does that in some places and products, but not all. But yes, I never noticed that. Thanks for your patience in pointing that out.

@ThinkingPolygons Hey, thanks for the examples! Weird that it does that in some places and products, but not all. But yes, I never noticed that. Thanks for your patience in pointing that out.
Member

Module meeting agreed on:

  • Have this be a boolean option, no need to overload the preferences for something this small.
  • Use the standard (Windows as reference, preferably what the "slow" standard is) blinking speed.
  • Only blink while the editor/widget is active.
Module meeting agreed on: * Have this be a boolean option, no need to overload the preferences for something this small. * Use the standard (Windows as reference, preferably what the "slow" standard is) blinking speed. * Only blink while the editor/widget is active.
Harley Acheson force-pushed TextCursors from 61a6a5ef47 to d38eaadfc0 2024-03-23 01:11:26 +01:00 Compare
Harley Acheson added 1 commit 2024-03-23 01:21:04 +01:00
Harley Acheson changed title from WIP: UI: Blinking Text Cursors to UI: Blinking Text Cursors 2024-03-23 01:43:05 +01:00
Harley Acheson added 2 commits 2024-03-26 22:58:55 +01:00
Member

Even though the behavior now is much nicer since it only blinks when needed, I think the option to toggle it off must come back.

In the same way that a blinking cursor is an accessibility feature (for example to make it easier to find the cursor for the visually impaired), being able to disable blinking is also an accesibility feature for those who prefer reduced motion.

If you google for "disable blink caret cursor" you'll find thousands of questions on how to disable it on all kinds of software (browsers, terminals, word processing, operating-system level).

Once the option to disable it comes back, to me this is ready to go +1

Even though the behavior now is much nicer since it only blinks when needed, I think the option to toggle it off must come back. In the same way that a blinking cursor is an accessibility feature (for example to make it easier to find the cursor for the visually impaired), being able to disable blinking is also an accesibility feature for those who prefer reduced motion. If you google for "disable blink caret cursor" you'll find thousands of questions on how to disable it on all kinds of software (browsers, terminals, word processing, operating-system level). Once the option to disable it comes back, to me this is ready to go +1
Harley Acheson added 2 commits 2024-04-10 18:41:43 +02:00
Harley Acheson added 1 commit 2024-04-10 19:28:52 +02:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
06d63f86fd
Cleanup
Author
Member

@blender-bot build

@blender-bot build
Harley Acheson added 2 commits 2024-04-11 03:48:00 +02:00
Pablo Vazquez approved these changes 2024-04-11 12:28:01 +02:00
Harley Acheson added 2 commits 2024-04-11 19:27:59 +02:00
Harley Acheson added 1 commit 2024-04-11 20:48:46 +02:00
Harley Acheson added 1 commit 2024-04-24 21:07:06 +02:00
Harley Acheson added 1 commit 2024-04-24 21:10:43 +02:00
Author
Member

@HooglyBoogly

I double-checked this and have to say I misspoke. Text Editor here uses a region draw_overlay for the cursor, but Console does not. I couldn't figure out how to do so with the way that it draws.

@HooglyBoogly I double-checked this and have to say I misspoke. Text Editor here uses a region draw_overlay for the cursor, but Console does not. I couldn't figure out how to do so with the way that it draws.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u TextCursors:Harley-TextCursors
git checkout Harley-TextCursors
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#116595
No description provided.