Improve the UI for the "make the editor follow the system color scheme" feature
Closed, ResolvedPublic

Description

Right now, if you switch to the Breeze Dark theme (or any dark theme), the app's menu bar, tab bar, and toolbars turn dark to respect the theme. But the actual text editing area remains eyeball-searing white.

There is in fact a way to make the editor view's own color scheme follow the system color scheme: SettingsConfigure KateFonts & ColorsClick the "Use KDE Color Scheme" button or Choose "KDE" in the "Default Schema for Kate" combobox

There are a few problems with this feature:

  1. It doesn't work: when following the system theme, using a dark theme makes the editor view unusable because the background changes its color to something dark, but the text remains dark rather than switching to some light text color in the system color scheme.
  2. It's hard to discover: the name of the system-color-scheme-following choice is "KDE" rather than something clear like "Follow system color scheme".
  3. It should be the default setting (once the above are fixed IMO).
  4. On the Configure KateFonts & Colors page, there are two comboboxes that have the same assortment of color schemes, one on top and one on the bottom. The bottom one is the one that actually works to apply a color scheme, while the top one appears to simply choose which color scheme's details are being displayed in the color editor view. At the minimum this arrangement should be inverted; the UI control that actually changes things (more common) should be on top, and the one that lets you choose an option for editing (less common) should be below this. Also it's confusing to have two comboboxes that have the same options. I would recommend re-implementing this as a grid view similar to what's in the Colors KCM, with each grid delegate displaying a preview of the color scheme, and with one of the items implementing the "Follow system color theme" behavior.

I could (and can, and will) file Bugzilla tickets tracking these individual items but I thought I'd file a Phab task first to discuss the project itself first.

ngraham created this task.Jun 10 2019, 10:07 PM

Actually, before one starts to touch this for such things, I would like to have the KTextEditor stuff ported to use the "themes" as provided by KSyntaxHighlighting.

I second Christoph's comment.

The idea for Themes is as follows:

  • themes provided by the installation are read-only
  • If you want to create a new theme, you copy an existing one and give it a unique new name

In addition: I propose to add a checkbox "[x] Follow KDE color scheme". If checked, I suggest to use an algorithm that smartly finds the best matching color theme from the existing ones. The "best match" could include:

  • match the background color of the KDE color theme
  • then match foreground color of the KDE color theme
  • then match text selection color of the KDE color theme.

I strongly suggest we do not auto-create any theme, as this will never work 100%. Instead, KSyntaxHighlighting should ship with more themes such that finding the best match should work by default very well.

I second Christoph's comment.

The idea for Themes is as follows:

  • themes provided by the installation are read-only
  • If you want to create a new theme, you copy an existing one and give it a unique new name

+1, that's essentially how the colors KCM works. This would allow us to hide the theme editing UI behind another window/page to de-clutter the main page.

In addition: I propose to add a checkbox "[x] Follow KDE color scheme". If checked, I suggest to use an algorithm that smartly finds the best matching color theme from the existing ones. The "best match" could include:

  • match the background color of the KDE color theme
  • then match foreground color of the KDE color theme
  • then match text selection color of the KDE color theme.

Makes sense to me. How would it figure out the colorized text though? Some colors that look find against a light background don't work against a dark background, and vice versa. I guess the algorithm could tweak these, too.

ngraham added a subscriber: apol.Jun 19 2019, 4:34 PM