Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 533778 - [Dark theme] Current heap in HeapMonitor is too light
Summary: [Dark theme] Current heap in HeapMonitor is too light
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.9 M2   Edit
Assignee: Roland Grunberg CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-18 12:13 EDT by Lars Vogel CLA
Modified: 2018-06-22 11:27 EDT (History)
3 users (show)

See Also:


Attachments
Screenshot (150.31 KB, image/png)
2018-04-18 12:14 EDT, Lars Vogel CLA
no flags Details
Existing Heap Status (Light / Dark Themed) (4.57 KB, image/png)
2018-06-07 15:36 EDT, Roland Grunberg CLA
no flags Details
Proposed Heap Status (Light / Dark Themed) (4.69 KB, image/png)
2018-06-07 15:41 EDT, Roland Grunberg CLA
no flags Details
Colors screenshot (120.26 KB, image/png)
2018-06-12 12:01 EDT, Lars Vogel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2018-04-18 12:13:42 EDT
The used heap color in the dark theme is IIRC hard-code and to light. We should make it configurable and find a better color.
Comment 1 Lars Vogel CLA 2018-04-18 12:14:03 EDT
Created attachment 273673 [details]
Screenshot
Comment 2 Lars Vogel CLA 2018-04-18 12:14:27 EDT
Roland, something for you?
Comment 3 Dani Megert CLA 2018-04-18 12:40:15 EDT
(In reply to Lars Vogel from comment #0)
> The used heap color in the dark theme is IIRC hard-code and to light. We
> should make it configurable and find a better color.

... too light ...
Comment 4 Roland Grunberg CLA 2018-06-07 15:36:14 EDT
Created attachment 274383 [details]
Existing Heap Status (Light / Dark Themed)
Comment 5 Roland Grunberg CLA 2018-06-07 15:41:41 EDT
Created attachment 274384 [details]
Proposed Heap Status (Light / Dark Themed)

I actually don't think the colour is so bad on the dark theme. It could be maybe a bit darker. Relevant constant is in HeapStatus, field usedMemCol.

Currently usedMemCol is rgb(162,162,161) (SWT.COLOR_WIDGET_NORMAL_SHADOW) for me on both light and dark themes. I would propose making it something like rgb(130,130,130). This should make it a bit darker on both themes. Specifically it'll improve the dark theme without affecting the light theme too much.

I could propose something for review if this is deemed worth changing.

diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/HeapStatus.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/HeapStatus.java
index ec21f7848f..c1cbe0ff7c 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/HeapStatus.java       
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/HeapStatus.java       
@@ -126,7 +126,8 @@ public class HeapStatus extends Composite {
                        imgBounds = gcImage.getBounds();
                        disabledGcImage = new Image(display, gcImage, SWT.IMAGE_DISABLE);
                }
-               usedMemCol = display.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
+
+               usedMemCol = new Color(display, 130, 130, 130);
                lowMemCol = new Color(display, 255, 70, 70);  // medium red
                freeMemCol = new Color(display, 255, 190, 125);  // light orange
                bgCol = display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
Comment 6 Roland Grunberg CLA 2018-06-07 15:46:08 EDT
Note: I have not tested this yet on Mac and Windows so if SWT.COLOR_WIDGET_NORMAL_SHADOW is a different constant (likely) then this approach fails and we'll need to find an actual constant that works better.
Comment 7 Lars Vogel CLA 2018-06-07 15:47:01 EDT
(In reply to Roland Grunberg from comment #6)
> Note: I have not tested this yet on Mac and Windows so if
> SWT.COLOR_WIDGET_NORMAL_SHADOW is a different constant (likely) then this
> approach fails and we'll need to find an actual constant that works better.

+1 for this. I the color would be a preference, we could style it in our CSS
Comment 8 Roland Grunberg CLA 2018-06-11 16:39:13 EDT
The colour seems to be roughly rgb(160,160,160) for light/dark themes on Mac and Windows so this could probably work.
Comment 9 Roland Grunberg CLA 2018-06-12 11:55:31 EDT
Ok, SWT.COLOR_TITLE_INACTIVE_FOREGROUND actually looks a bit better, but it should probably only be used in the case of GTK.

Lars, I've noticed that in your screenshot (Ubuntu Ambiance ?), the colour used is rgb(169,169,168) while on mine (Fedora Adwaita), it's rgb(162,162,162). The slight theme difference is probably why it seems not so bad for me.

Is there any chance you could run ControlExample from eclipse.platform.swt//examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java, and take a screenshots of the Color tab to have a rough idea of how things currently differ ?
Comment 10 Lars Vogel CLA 2018-06-12 12:01:34 EDT
Created attachment 274442 [details]
Colors screenshot
Comment 11 Lars Vogel CLA 2018-06-12 12:01:59 EDT
(In reply to Roland Grunberg from comment #9)

> Is there any chance you could run ControlExample from
> eclipse.platform.swt//examples/org.eclipse.swt.examples/src/org/eclipse/swt/
> examples/controlexample/ControlExample.java, and take a screenshots of the
> Color tab to have a rough idea of how things currently differ ?

Of course, thanks for looking into this issue.
Comment 12 Lars Vogel CLA 2018-06-22 04:49:38 EDT
(In reply to Lars Vogel from comment #11)
> Of course, thanks for looking into this issue.

Roland, could you provide a Gerrit for this?
Comment 13 Roland Grunberg CLA 2018-06-22 10:17:21 EDT
(In reply to Lars Vogel from comment #12)
> (In reply to Lars Vogel from comment #11)
> > Of course, thanks for looking into this issue.
> 
> Roland, could you provide a Gerrit for this?

Sure, sorry for the delay, seems I missed your screenshot attachment.
Comment 14 Eclipse Genie CLA 2018-06-22 10:31:32 EDT
New Gerrit change created: https://git.eclipse.org/r/124898
Comment 16 Lars Vogel CLA 2018-06-22 11:27:33 EDT
Thanks Roland.