This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 257675 - Hardcoded colors in OptionsPanel, SearchBar, GlyphGutter, AbstractSearchResultsPanel, ToolbarWithOverflow, LayoutPainter, DiffSplitPaneDivider
Summary: Hardcoded colors in OptionsPanel, SearchBar, GlyphGutter, AbstractSearchResul...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 8.0
Hardware: PC All
: P3 normal with 4 votes (vote)
Assignee: Antonin Nebuzelsky
URL:
Keywords: NETFIX
Depends on:
Blocks:
 
Reported: 2016-01-22 12:12 UTC by Revivius
Modified: 2016-07-25 01:54 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Revivius 2016-01-22 12:12:51 UTC
Following classes contain hardcoded colors and causing problems with different look and feels, especially dark ones:

1) org.netbeans.modules.editor.search.SearchBar: NOT_FOUND = Color.RED.darker();
2) org.netbeans.editor.GlyphGutter: DEFAULT_GUTTER_LINE = new Color(184, 184, 184);
3) org.netbeans.modules.search.ui.AbstractSearchResultsPanel:180: contentPanel.setBorder(BorderFactory.createLineBorder(new Color(153, 153, 153)));
4) org.netbeans.modules.options.OptionsPanel#CategoryButton: background, foreground and borders are hardcoded, special colors provided for Nimbus they are also hardcoded.

I would like to suggest:

1) Use LFCustoms.ERROR_FOREGROUND ("nb.errorForeground")
2, 3) Use LFCustoms.SCROLLPANE_BORDER_COLOR ("Nb.ScrollPane.Border.color")
4) Could introduce new UIManager keys or at least fallback to Tree|Table|List colors.
Comment 1 Revivius 2016-01-26 20:29:23 UTC
I would like to report more hardcoded colors:


1) org.netbeans.modules.form.layoutdesign.LayoutPainter:
  - line 976: Color gapBorderColor = new Color(200, 200, 200);
  - line 977: Color sawColor = new Color(208, 208, 208);
2) org.openide.awt.ToolbarWithOverflow:
  - line 142: overflowToolbar.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY, 1));
3) org.netbeans.modules.diff.builtin.visualizer.editable.DiffSplitPaneDivider:
  - line 255: g.setColor(Color.LIGHT_GRAY);


I would like to suggest using SCROLLPANE_BORDER_COLOR for all three cases:
 Use LFCustoms.SCROLLPANE_BORDER_COLOR ("Nb.ScrollPane.Border.color")
Comment 2 Geertjan Wielenga 2016-02-05 21:05:51 UTC
Added 'fix-in-82' in status whiteboard.
Comment 3 Rahul.khandelwal 2016-07-19 05:31:32 UTC
As @Revivius mentioned in https://github.com/Revivius/nb-darcula/issues/108,
Following code also has hardcoded colour for javascript documentation window:

http://hg.netbeans.org/main/file/294dca090459/javascript2.editor/src/org/netbeans/modules/javascript2/editor/doc/JsDocumentationPrinter.java#l141

Above code also should be fixed along with other hardcoded colour issues.
Comment 4 markiewb 2016-07-23 14:20:05 UTC
For reference https://github.com/Revivius/nb-darcula/issues/39
Comment 5 markiewb 2016-07-24 16:03:46 UTC
*fixed*

http://hg.netbeans.org/core-main/rev/93615abab29f

* use UIManager.getColor("controlShadow") instead of gray color
* use UIManager.getColor("nb.errorForeground") instead of red color
* introduce "nb.formdesigner.gap.border.color"/"nb.formdesigner.saw.color", but keep fallback to old colors for LaFs, which do not provide the colors

I did not update org.netbeans.modules.options.OptionsPanel. To much to do there.
Comment 6 Quality Engineering 2016-07-25 01:54:53 UTC
Integrated into 'main-silver', will be available in build *201607250002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/93615abab29f
User: Benno Markiewicz <markiewb@netbeans.org>
Log: #257675 - Hardcoded colors in SearchBar, GlyphGutter, AbstractSearchResultsPanel, ToolbarWithOverflow, LayoutPainter, DiffSplitPaneDivider

 * use UIManager.getColor("controlShadow") instead of gray color
 * use UIManager.getColor("nb.errorForeground") instead of red color
 * introduce "nb.formdesigner.gap.border.color"/"nb.formdesigner.saw.color", but keep fallback to old colors for LaFs, which do not provide the colors