eclipse-mylyn / org.eclipse.mylyn

Eclipse Public License 2.0
14 stars 9 forks source link

Support Dark Theme #44

Open gnl42 opened 1 year ago

gnl42 commented 1 year ago

Mylyn doesn't play well with Dark Theme. It uses hard coded colors that are close to impossible to read in Dark Mode.

An example is TaskScalingHyperlink which uses CommonColors.HYPERLINK_WIDGET

`public class CommonColors {

    public static final Color HYPERLINK_WIDGET = new Color(Display.getDefault(), 12, 81, 172);

    public static final Color TEXT_QUOTED = new Color(Display.getDefault(), 38, 86, 145);

`

image (It's worse on my monitor)

wimjongman commented 1 year ago

Patches are welcome.

BeckerFrank commented 1 year ago

What is with the other Color Definitions? We also have Class org.eclipse.mylyn.internal.context.ui.ColorMap.

gnl42 commented 1 year ago

And org.eclipse.mylyn.internal.commons.ui.E4ThemeColor which tries to parse #org-eclipse-ui-workbench-DARK_BACKGROUND as a RGB value:

java.lang.NumberFormatException: For input string: "or" under radix 16 at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67) at java.base/java.lang.Integer.parseInt(Integer.java:668) at org.eclipse.mylyn.internal.commons.ui.E4ThemeColor.getRGBFromCssString(E4ThemeColor.java:57) at org.eclipse.mylyn.commons.ui.GradientColors.getRGBFromTheme(GradientColors.java:211)

"Fixed" by #298

gnl42 commented 1 year ago

I could use suggestions/pointers on how to go about doing this.

I have no experience with SWT UI programming. Trying to make sense of the various articles on Eclipse themes but unsure how to actually apply them..

Are custom colours really needed? Or are Eclipse defaults good enough?

wimjongman commented 1 year ago

Are custom colours really needed? Or are Eclipse defaults good enough?

When possible, Eclipse defaults would be the way to go.

https://www.vogella.com/tutorials/Eclipse4CSS/article.html contains many clues, but you probably already found it.

Theming is based on CSS, and when the plugin spy is installed, you can use CTRL+ALT+SHIFT+F6 to see how the component is styled.

Please ask specific questions and I will help.

gruscoe-papajohns commented 3 months ago

I am also facing this issue - and with the very latest release - Do we have any css info that can be manually added to

plugins/org.eclipse.ui.themes_1.2.2400.v20240213-1133/css/e4-dark_linux.css

to specify font colors for mylyn?

BeckerFrank commented 1 week ago

@gnl42: We have deprecated CommonColors, can we close this issue or do you know another place with hard coded colors?

gnl42 commented 1 week ago

There is org.eclipse.mylyn.internal.context.ui.ColorMap as well.

gnl42 commented 1 week ago

Also TaskEditorFindSupport

mjmeijer commented 6 days ago

There was also a hard coded font and highlight color in the Task Context Decorator that caused problems since navigator can be set with font prefs as well. Old bug already in bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=321336