Skip to content

Commit

Permalink
[NETBEANS-5864] Sightly better support of GTK with a dark theme
Browse files Browse the repository at this point in the history
  • Loading branch information
lkishalmi committed Jul 18, 2021
1 parent 2a603b6 commit 60b1d34
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ SCROLLPANE_BORDER, new JScrollPane().getViewportBorder(),
@Override
public Object[] createLookAndFeelCustomizationKeysAndValues() {
if (ThemeValue.functioning()) {
// Better than nothing detection of GTK dark themes
ThemeValue textText = new ThemeValue (Region.PANEL, ColorType.TEXT_FOREGROUND, Color.BLACK);
ThemeValue text = new ThemeValue (Region.PANEL, ColorType.TEXT_BACKGROUND, Color.GRAY);
Boolean dark = UIUtils.isBrighter(textText.getColor(), text.getColor());

return new Object[] {
//XXX once the JDK team has integrated support for standard
//UIManager keys into 1.5 (not there as of b47), these can
Expand All @@ -154,12 +159,16 @@ public Object[] createLookAndFeelCustomizationKeysAndValues() {
"controlShadow", new ThemeValue (Region.PANEL, ThemeValue.DARK, Color.DARK_GRAY), //NOI18N
"controlDkShadow", new ThemeValue (Region.PANEL, ThemeValue.BLACK, Color.BLACK), //NOI18N
"controlLtHighlight", new ThemeValue (Region.PANEL, ThemeValue.WHITE, Color.WHITE), //NOI18N
"textText", new ThemeValue (Region.PANEL, ColorType.TEXT_FOREGROUND, Color.BLACK), //NOI18N
"text", new ThemeValue (Region.PANEL, ColorType.TEXT_BACKGROUND, Color.GRAY), //NOI18N
"textText", textText, //NOI18N
"text", text, //NOI18N


"nb.dark.theme", dark, //NOI18N
"nb.wizard.hideimage", dark, //NOI18N

"tab_unsel_fill", control, //NOI18N

"SplitPane.dividerSize", new Integer (2), //NOI18N
"SplitPane.dividerSize", 2, //NOI18N

SYSTEMFONT, controlFont, //NOI18N
USERFONT, controlFont, //NOI18N
Expand Down

0 comments on commit 60b1d34

Please sign in to comment.