Community
Participate
Working Groups
This is a consolidation of Bug 508776 and Bug 508494, for clarity and consistency. Currently, the strip at the bottom of Javadoc hover has a different background from the main body. (See "different color" screenshot). It should look the same. (See "Fix, same color" screenshot). The solution consists of two parts: 1) Status bar should get painted. git:eclipse.platform.text project:jface.text->AbstractInformationControl.java This Control doesn't set colors for it's status bar element upon initialization and set(Foreground|Background) methods. 2) JavaDoc hover should set and update AbstractInformationControl's colors. git:eclipse.jdt.ui project:eclipse.jdt.ui -> JavadocHover.java a) When HoverControlCreator creates a BrowserInformationControl (which is an extension of AbstractInformationControl), it should set foreground/background colors as per Javadoc user preference b) It should also update them when user changes "Javadoc" color in preferences. DARK THEME NOTE: At time of writing, I couldn't get the mechanism to work on Gtk's Dark theme. The dark-theme overrides the colours of status composite manually independent of JDT. I.e 3 things happen: 1) AbstractInformationControl is created with default colors 2) JavadocHover applies foreground/background colors 3) Dark theme overrides composite/label colors with it's own styles. (<< problem). As a result the strip at the bottom in GTK's dark theme receives theaming colours. I will investigate this separately and will probably need some help from someone knowledgeable. For now, I'll submit patch 1 & 2 to fix on regular Eclipse.
Created attachment 268076 [details] Problem Screenshot - different colors
Created attachment 268077 [details] Solution screenshot - Same colors
New Gerrit change created: https://git.eclipse.org/r/96066
*** Bug 508494 has been marked as a duplicate of this bug. ***
*** Bug 508776 has been marked as a duplicate of this bug. ***
Awaiting patch reviews.
Gerrit change https://git.eclipse.org/r/96065 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=73ff2c16d11d91e0ca6c479cf07cb665309d3bbd
Gerrit change https://git.eclipse.org/r/96066 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=1ced1b594fcdd3fd43ef1529449ef77eb8cadaa4
NOTE TO SELF: Below are notes for dark-theme related work: (To be used to investigate strip on the bottom on dark theme). Although at the moment it looks pretty decent on Dark theme, it is a slightly lower priority for now. / ---- Apply skin for dark theme. But not optimal performance? JavadocHover.java:doCreateInformationControl() ... // TODO - remove this listener if disposed? // Display.getDefault().addListener(SWT.Skin, new Listener() { //// iControl.fStatusLabel.addListener(SWT.Skin, new Listener() { // @Override // public void handleEvent(Event event) { // ColorRegistry registry2 = JFaceResources.getColorRegistry(); // Color fgRGB2 = registry2.get("org.eclipse.jdt.ui.Javadoc.foregroundColor"); //$NON-NLS-1$ // Color bgRGB2 = registry2.get("org.eclipse.jdt.ui.Javadoc.backgroundColor"); //$NON-NLS-1$ // iControl.setStatusColors(fgRGB2, bgRGB2); // } // }); // ---- Find what's triggering color change by dark theme. Control: public void setForeground (Color color) { // if (this instanceof Label) { // Label label = (Label) this; // if (label.getText().contains("F2")) { // String col = ""; // if (color != null) // col = color.toString(); // System.out.println("LABEL COLOR CHANGE:" + col); // if (col.contains("238")) { // System.out.println("Gray"); // } // } // } // Don't style that label org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles(Object, boolean, boolean) // if ("Label".equals(elt.getNodeName())) { // if (elt instanceof Widget) { // Widget widget = (Widget) element; // Label label = (Label) widget; // if (label.getText().contains("F2")) { // System.out.println("LABEL COLOR CHANGE AT CSS LEVEL"); // return; // } // } // }