Darcula icon indicating copy to clipboard operation
Darcula copied to clipboard

Support dark title bars on macOS Mojava 10.14

Open freeasbird opened this issue 7 years ago • 2 comments

The Darcula theme is cool. Is there a simple way to support dark title on new macOS dark mode? I know IntelliJ IDEA use special setting (Appearance -> "Use dark window header" ) to support the feature. Hope built-in Darcula theme can support the feature. I hope the Darcula theme will be more professional and simple to configure. :) Maybe useful links: http://www.java2s.com/Tutorials/Java/Swing_How_to/JFrame/Change_the_color_of_titlebar_in_JFrame.htm https://bugs.openjdk.java.net/browse/JDK-8181910

freeasbird avatar Jan 12 '19 03:01 freeasbird

If you are using the regular OpenJDK, you need to wait until https://bugs.openjdk.java.net/browse/JDK-8214131 is fixed. Alternatively, you can use a JetBrains JDK from https://bintray.com/jetbrains/intellij-jdk/openjdk8-osx-x64 (or perhaps https://bintray.com/jetbrains/intellij-jdk/openjdk9-osx-x64 , but I have not tried v9 yet).

To enable dark title bars set this client property on your JFrame or JDialog, i.e. on your RootPaneContainer:

public static final String JETBRAINS_AWT_WINDOW_DARK_APPEARANCE = "jetbrains.awt.windowDarkAppearance";
JFrame window = ...
window.getRootPane().putClientProperty(JETBRAINS_AWT_WINDOW_DARK_APPEARANCE, true);

hendriks73 avatar Jan 12 '19 08:01 hendriks73

Thank you for your reply @hendriks73 With the JDK solution, each Jframe or jdialog will write the special code again, that isn't good solution. :))))

I mean , is there a way let the Darcula wrap the special code or other simple way. Or use a fake title: f.setUndecorated(true); f.getRootPane().setWindowDecorationStyle(......); .......

It's just a suggestion for the project, it's not an issue for Darcula itself. :)

freeasbird avatar Jan 12 '19 11:01 freeasbird