Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 430741

Summary: [CSS] [dark theme] Package Explorer text colors are black on black on Dark Theme (based on EGit preferences)
Product: [Technology] EGit Reporter: Gorkem Ercan <gorkem.ercan>
Component: UIAssignee: Project Inbox <egit.ui-inbox>
Status: RESOLVED FIXED QA Contact: Lars Vogel <Lars.Vogel>
Severity: normal    
Priority: P3 CC: adam.gent, andrea.guarinoni, daniel.rolka, kaloyan, Lars.Vogel, matteo.mortari, matthias.sohn, piero.campa, psuzzi
Version: 3.4   
Target Milestone: 3.4   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:
Bug Depends on:    
Bug Blocks: 433475, 435083    
Attachments:
Description Flags
screenshot
none
black text on dark background none

Description Gorkem Ercan CLA 2014-03-19 18:09:41 EDT
Some of the lines on the dark theme are black on black when using dark theme
Comment 1 Gorkem Ercan CLA 2014-03-19 18:11:10 EDT
Created attachment 241029 [details]
screenshot

a screenshot of the problem
Comment 2 Lars Vogel CLA 2014-03-19 21:40:40 EDT
Gorkem, is this something which can be configured in the "Colors and Fonts" part of the preferences? If yes, could you name the perference key? Otherwise this is currently not stylable via CSS.
Comment 3 Gorkem Ercan CLA 2014-03-19 21:47:57 EDT
I am not sure... But the main problem is the text color for only some of the tree items are black and the rest are white. I could not catch a pattern. I only observe this when the dark theme is on.
Comment 4 Timo Kinnunen CLA 2014-03-20 08:05:46 EDT
It should be styleable with CSS. These CSS snippets change the colors of trees at least in Java perspective for me, on WIndows:

.MPartStack .MPart Tree {
background-color: #000000 #48585e #284049 #48585e 0% 99% 100% false;
color: #ffffff;
}
.MPartStack.active .MPart Tree {
background-color: #000000 #1eade3 #f5f6f7 #1eade3 0% 1% 100% false;
color: #000000;
}

I'm currently adding something similar using Jeeeyul's Eclipse Themes plugin.
Comment 5 Andrea Guarinoni CLA 2014-03-24 07:23:44 EDT
This is probably the color of the shared folder/files.

Can you try if after importing this epf (https://github.com/guari/eclipse-ui-theme/blob/master/com.github.eclipseuitheme.themes.plugin/bin/color-scheme/RainbowDrops.epf?raw=true) the color changes?
To import use: File > Import... then select General > Preferences.

(Take a backup of your settings before trying: File > Export... then select General > Preferences)
Comment 6 Gorkem Ercan CLA 2014-05-07 12:14:22 EDT
I just figured out the black foreground color is coming from Git "uncommitted change"(foreground)" preference.
Comment 7 Lars Vogel CLA 2014-05-07 15:59:31 EDT
(In reply to Gorkem Ercan from comment #6)
> I just figured out the black foreground color is coming from Git
> "uncommitted change"(foreground)" preference.

Can you identify the preference key? If, than EGit could fix that with an extension to the dark theme.
Comment 8 Andrea Guarinoni CLA 2014-05-07 16:31:59 EDT
(In reply to Lars Vogel from comment #7)
> (In reply to Gorkem Ercan from comment #6)
> > I just figured out the black foreground color is coming from Git
> > "uncommitted change"(foreground)" preference.
> 
> Can you identify the preference key? If, than EGit could fix that with an
> extension to the dark theme.

Previous .epf link, 'org.eclipse.ui.workbench/org.eclipse.egit.ui.*' values ;)
Comment 9 Gorkem Ercan CLA 2014-05-07 21:38:45 EDT
org.eclipse.ui.workbench/org.eclipse.egit.ui.UncommittedChangeForegroundColor fixes it for me.
Comment 10 Matthias Sohn CLA 2014-05-08 02:34:15 EDT
I don't understand what you want us to do in order to help fixing this issue.
Comment 11 Lars Vogel CLA 2014-05-08 02:53:05 EDT
(In reply to Gorkem Ercan from comment #9)
> org.eclipse.ui.workbench/org.eclipse.egit.ui.
> UncommittedChangeForegroundColor fixes it for me.


Gorkem, can you create a Gerrit review with your preferred setting for EGit UI? The change would be similar to https://git.eclipse.org/r/#/c/26006/

The contribututed CSS would look similar to
 
IEclipsePreferences#org.eclipse.ui.workbench {
	preferences:
		'org.eclipse.egit.ui.UncommittedChangeForegroundColor=52,57,61'
}

with the correct color code (I just left the color code in for you as example).

@Matthias, does this also answer your question? Some background: Platform is not allowed to set values for EGit but we enabled projects to contribute to the dark theme their specific setting. 

Note:  I'm surprised EGit is using org.eclipse.ui.workbench as preference store. What is the background of that?
Comment 12 Andrea Guarinoni CLA 2014-05-08 13:53:18 EDT
Gerrit review: https://git.eclipse.org/r/#/c/26227/


(I was wondering if the new CSS preferences for org.eclipse.ui.workbench override the others defined in Platform stylesheet...)
Comment 13 Matthias Sohn CLA 2014-05-08 17:43:17 EDT
(In reply to Lars Vogel from comment #11)
> Note:  I'm surprised EGit is using org.eclipse.ui.workbench as preference
> store. What is the background of that?

where did you find that EGit is using org.eclipse.ui.workbench as preference store ?
Comment 14 Matthias Sohn CLA 2014-05-08 17:54:20 EDT
(In reply to Andrea Guarinoni from comment #12)
> Gerrit review: https://git.eclipse.org/r/#/c/26227/
 
thanks for the patch, how can I test it ?
 
> (I was wondering if the new CSS preferences for org.eclipse.ui.workbench
> override the others defined in Platform stylesheet...)
Comment 15 Paul Webster CLA 2014-05-08 18:59:58 EDT
(In reply to Matthias Sohn from comment #13)
> 
> where did you find that EGit is using org.eclipse.ui.workbench as preference
> store ?

It's in the epf file linked from comment #5

/instance/org.eclipse.ui.workbench/org.eclipse.egit.ui.UncommittedChangeBackgroundColor=32,32,32

That means it's in the org.eclipse.ui.workbench node.  Can you point to where that pref is set or used in your code?

PW
Comment 16 Andrea Guarinoni CLA 2014-05-09 12:20:49 EDT
(In reply to Matthias Sohn from comment #14)
> (In reply to Andrea Guarinoni from comment #12)
> > Gerrit review: https://git.eclipse.org/r/#/c/26227/
>  
> thanks for the patch, how can I test it ?
>  
> > (I was wondering if the new CSS preferences for org.eclipse.ui.workbench
> > override the others defined in Platform stylesheet...)

Apply the patch and start a new Eclipse instance/workspace, then go to 'Preferences > Appearance' and switch the theme to 'Dark', you should see that the colors defined into 'e4-dark_egit_prefstyle.css' are automatically loaded as default in 'Preferences > Appearance > Colors and Fonts : Git node'.

Check also that switching to 'Dark' with or without the patch gives the same result for colors defined in 'Preferences > Appearance > Colors and Fonts : Basic node'.
Comment 17 Matthias Sohn CLA 2014-05-09 17:51:38 EDT
(In reply to Paul Webster from comment #15)
> (In reply to Matthias Sohn from comment #13)
> > 
> > where did you find that EGit is using org.eclipse.ui.workbench as preference
> > store ?
> 
> It's in the epf file linked from comment #5
> 
> /instance/org.eclipse.ui.workbench/org.eclipse.egit.ui.
> UncommittedChangeBackgroundColor=32,32,32
> 
> That means it's in the org.eclipse.ui.workbench node.  Can you point to
> where that pref is set or used in your code?

https://git.eclipse.org/c/egit/egit.git/tree/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecorator.java
lines 93, 402, 635

https://git.eclipse.org/c/egit/egit.git/tree/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIPreferences.java
line 88

https://git.eclipse.org/c/egit/egit.git/tree/org.eclipse.egit.ui/plugin.xml
line 548
Comment 18 Matthias Sohn CLA 2014-05-09 18:15:53 EDT
Created attachment 242916 [details]
black text on dark background
Comment 19 Matthias Sohn CLA 2014-05-09 18:17:30 EDT
(In reply to Andrea Guarinoni from comment #16)
> (In reply to Matthias Sohn from comment #14)
> > (In reply to Andrea Guarinoni from comment #12)
> > > Gerrit review: https://git.eclipse.org/r/#/c/26227/
> >  
> > thanks for the patch, how can I test it ?
> >  
> > > (I was wondering if the new CSS preferences for org.eclipse.ui.workbench
> > > override the others defined in Platform stylesheet...)
> 
> Apply the patch and start a new Eclipse instance/workspace, then go to
> 'Preferences > Appearance' and switch the theme to 'Dark', you should see
> that the colors defined into 'e4-dark_egit_prefstyle.css' are automatically
> loaded as default in 'Preferences > Appearance > Colors and Fonts : Git
> node'.
> 
> Check also that switching to 'Dark' with or without the patch gives the same
> result for colors defined in 'Preferences > Appearance > Colors and Fonts :
> Basic node'.

This works nicely with

Theme: dark
Color and font theme: default

but when I set

Color and font theme: reduced palette

the git decoration on projects again uses black text on dark background, see attachment
Comment 20 Andrea Guarinoni CLA 2014-05-10 09:09:04 EDT
(In reply to Matthias Sohn from comment #19)
> 
> This works nicely with
> 
> Theme: dark
> Color and font theme: default
> 
> but when I set
> 
> Color and font theme: reduced palette
> 
> the git decoration on projects again uses black text on dark background, see
> attachment

Thanks for testing Matthias, the latest issue is not related to Egit configuration, it is the value assigned in org.eclipse.ui.workbench/DECORATIONS_COLOR for 'Reduced Palette'.

At this time, only the 'Default' ColorsAndFonts theme can be extended.
Can you open another bug for it in Platform UI?

A possible workaround might be patching EGit by adding a dedicated preference for it by overriding the workbench value but it's a deprecable behavior.

See also the more generic Bug 432750 that may address those kinds of issues.
Comment 21 Matthias Sohn CLA 2014-05-11 07:17:05 EDT
merged as bd2f78535f4a923e79f5e8db898d91f17c1c1a2a
Comment 22 Paul Webster CLA 2014-05-12 08:19:58 EDT
Thanks Matthias,

(In reply to Matthias Sohn from comment #17)
> https://git.eclipse.org/c/egit/egit.git/tree/org.eclipse.egit.ui/plugin.xml
> line 548

It looks like color and font definitions through the 3.x themes extension point end up saved as preferences on the o.e.ui.workbench pref node.  How odd.  I'm going to look into it, but we won't be changing it as it's more of a curiosity than a software problem.

Even if it was a real pref set on o.e.ui.workbench, it was more of a question of how than an actual problem (the only potential problem is starting a bundle early, and o.e.ui.workbench is probably started before EGit UI :-)

PW
Comment 23 Kaloyan Raev CLA 2014-11-17 04:40:58 EST
I see this problem in EGit 3.5.1. Is it only me or there is a regression?
Comment 24 Kaloyan Raev CLA 2014-11-17 05:19:20 EST
Perhaps a false alarm. I launched the IDE in a new workspace and the problem has gone...
Comment 25 Piero Campalani CLA 2015-02-03 10:34:47 EST
Still getting black text here with EGit 3.6.2 on Luna (Linux 86_x64) with a dark theme.

Any clue?
Thanks.
Comment 26 Adam Gent CLA 2015-09-08 16:15:02 EDT
I still see this issues with Eclipse Mars and I guess Egit 4.0.0
Comment 27 Kaloyan Raev CLA 2015-09-09 01:32:22 EDT
I also see it from time to time, but I have no clear steps to reproduce. Switching to a new workspace always helps.
Comment 28 Matteo Mortari CLA 2016-01-11 09:44:58 EST
Brand-new Eclipse Mars.1 v4.5.1 had again this problem.
I changed General > Appearance > Colors and Font > Git > Uncommitted Change (Foreground) manually from black to white.
Comment 29 Patrik Suzzi CLA 2016-07-08 05:18:28 EDT
There is a regression in Neon, tracked via Bug 496585 - [Dark Theme] black labels UI coloring bug on package explorer and outline