Page MenuHome

UI: Text Editor Visual Changes

Authored by Harley Acheson (harley) on Sun, Nov 17, 8:46 PM.
"Like" token, awarded by threedslider."Dat Boi" token, awarded by shader."Love" token, awarded by tintwotin."Like" token, awarded by leonumerique."Like" token, awarded by pablovazquez."Like" token, awarded by amonpaike.



Lots of small miscellaneous changes and cleanup to how the Text Editor looks.

  • Adds a theme item for the color of line numbers. This way the color can be toned down, or differ from text color. And also works better when using a light background.
  • Removes all instances of placement and alignment involving non-scaled constants
  • More padding around the line numbers and between them and the text.
  • Multiple-line selection boxes no longer have an odd ragged left side.
  • Text insertion caret is now scaled with the rest of the UI, so will be more readable on high-dpi displays like Retina. Also adjusted the placement of it, including in "insert" mode so it covers existing characters a bit less.
  • The right "Margin line" is done in a way that works on light backgrounds.
  • The "Highlight Line" option is one in a way that works on light backgrounds

With the current default theme, the following illustrates the changes in padding and alignment. Left is current, right is after patch is applied:

Following closeup (at 4X UI scale) shows changes to number padding and size and placement of cursor in "insert" mode:

Following shows how the dimming of the line numbers can help replicate the look of VSCode:

The following illustrates how the changes allow a theme designer to select a very light background, here looking like MSVS:

Diff Detail

rB Blender

Event Timeline

Generally fine, only minor comment about macros.


Even though this is an internal include, would prefer use TXT_ prefix, eg:

TXT_COLUMN_WIDTH, TXT_COLUMN_PAD (or something like this).

Also, these macros should take st as an argument (noticed macros below don't do this, even so - they should).

This revision is now accepted and ready to land.Wed, Nov 20, 7:53 AM

Updating before committing as per review by @Campbell Barton (campbellbarton)

...would prefer use TXT_ prefix

macro names changed as requested

macros should take st as an argument (noticed macros below don't do this, even so - they should).

Did so for all.

This revision was automatically updated to reflect the committed changes.