Community
Participate
Working Groups
Created attachment 253127 [details] Background color of Heap Monitor in Dark Theme. Build ID: 20150502-1500 Locale: English Steps to reproduce: 1. Click Window -> Preferences 2. Click General -> Appearance. 3. Change the Theme to Dark. 4. Click Apply button. 5. Click on General. 6. Check the "Show heap status" option. 7. Click Apply button. Problem Description: The background color should be black not white.
I think you do not mean the background color but the usedMemCol which is used to draw the border on the HeapMonitor. This is currently hard coded to SWT.COLOR_INFO_BACKGROUND, in HeapStatus line 133: usedMemCol = display.getSystemColor(SWT.COLOR_RED);
New Gerrit change created: https://git.eclipse.org/r/47073
(In reply to Eclipse Genie from comment #2) > New Gerrit change created: https://git.eclipse.org/r/47073 This implementation "recycles" the setForeground method for the used memory indicator. This allows me to implement this relatively easy, as I do not need an additional CSS handler. Jack or Fabio can you test the change? On Linux SWT.COLOR_INFO_BACKGROUND is already black.
(In reply to Lars Vogel from comment #1) > usedMemCol = display.getSystemColor(SWT.COLOR_RED); usedMemCol = display.getSystemColor(SWT.COLOR_INFO_BACKGROUND);
Hi Lars, I just checked the patch and it's still not working on windows. There are some details: 1. The label color on the heap is still black 2. The color for drawing the memory usage is still SWT.COLOR_INFO_BACKGROUND For 2. the reason it seems to happen is because the setForeground() is never called (it gets called if you set a color different from black, such as red -- so, I guess this happens because getForeground() is returning black, so setForeground() is never called -- so, you probably also need to override the getForeground() to return the used color). I.e.: @Override public Color getForeground() { if (usedMemCol != null) { return usedMemCol; } return getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND); } For 1. it seems that this isn't addressed in the patch (although it's still a problem -- I don't see any styling option for that, probably the proper way here would be actually creating a HeapStatusSWTHandler (which extends AbstractCSSPropertySWTHandler) to set the text color?
(In reply to Fabio Zadrozny from comment #5) > Hi Lars, > > I just checked the patch and it's still not working on windows. > > There are some details: > > 1. The label color on the heap is still black Funny, these platform differences. This is white on Linux. > 2. The color for drawing the memory usage is still SWT.COLOR_INFO_BACKGROUND > > For 2. the reason it seems to happen is because the setForeground() is never > called (it gets called if you set a color different from black, such as red > -- so, I guess this happens because getForeground() is returning black, so > setForeground() is never called -- so, you probably also need to override > the getForeground() to return the used color). Thanks. Gerrit review adjust. Would be great if you can test it, if that works now under Window? > For 1. it seems that this isn't addressed in the patch (although it's still > a problem -- I don't see any styling option for that, probably the proper > way here would be actually creating a HeapStatusSWTHandler (which extends > AbstractCSSPropertySWTHandler) to set the text color? If we introduce a new CSS handler, we should most like use it to set the memory usage color and use setForeground for the text color.
Created attachment 253145 [details] Heap on windows with patch applied I'm posting a screenshot on how it looks on windows (with the getForeground applied too)... I think that either those colors should be lighter on Windows so that the text can actually be seen (which should be something fast to do) or a proper handler should be created -- probably best choice if you have the time to do that ;)
Gerrit change https://git.eclipse.org/r/47073 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=0e2a41e90dd981e00494bae49fa59ccb0c34c246
(In reply to Eclipse Genie from comment #8) > Gerrit change https://git.eclipse.org/r/47073 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/ > ?id=0e2a41e90dd981e00494bae49fa59ccb0c34c246 This fixes the reported issue. It does NOT configure the text color, which is still black. If that is also required, please open a new bug report for this.
This bug is fixed in build I20150509-1500.
See bug #466275 which describes a related problem on macOS 10.14.