|Generic text editor and syntax highlighting defaults of presentation reconciler [message #1806157]
||Fri, 03 May 2019 23:54
| Alexandros Karypidis
Registered: March 2010
I have contributed a presentation reconciler (org.eclipse.ui.genericeditor.presentationReconcilers) for a content type (org.eclipse.core.contenttype.contentTypes) bound to the generic text editor (org.eclipse.ui.editors of org.eclipse.ui.genericeditor.GenericEditor).
For syntax highlighting I've contributed a theme (org.eclipse.ui.themes) which defines colors for keywords, etc.
This all works great, but when I switched to test the dark theme, I realised that my keyword colors (dark blue) are barely visible against the dark background. At the same time, all text that is not styled by my presentation reconciler switched from being "black foreground" in the light theme, to being "white foreground" in the dark theme and shows very nicely.
In short, all colors I defined in my theme are dark and therefore everything I touch in my presentation reconciler looks terrible in dark theme, whereas everything I did NOT touch switches from a dark to a light font thus looking really nice.
How can I fix my colors so that they behave like the default text? I would like to have two sets of defaults: one for light themes and one for dark themes and switch between them as appropriate (unless the user has specified some specific color in preferences)...
Am I supposed to define two themes and switch between them with some listener for when the theme changes? And how do I know that some them is light or dark? I could identify the "magic names" of the themes that ship with Eclipse by default, but what if the user picks a theme that is not standard?
Powered by FUDForum
. Page generated in 0.01261 seconds