< prev index next >

src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java

Print this page

        

@@ -99,10 +99,11 @@
     private static final PlatformLogger focusLogger = PlatformLogger.getLogger("sun.lwawt.macosx.focus.CPlatformWindow");
 
     // for client properties
     public static final String WINDOW_BRUSH_METAL_LOOK = "apple.awt.brushMetalLook";
     public static final String WINDOW_DRAGGABLE_BACKGROUND = "apple.awt.draggableWindowBackground";
+    public static final String WINDOW_DARK_APPEARANCE = "apple.awt.windowDarkAppearance";
 
     public static final String WINDOW_ALPHA = "Window.alpha";
     public static final String WINDOW_SHADOW = "Window.shadow";
 
     public static final String WINDOW_STYLE = "Window.style";

@@ -146,10 +147,11 @@
     static final int RESIZABLE = 1 << 9; // both a style bit and prop bit
     static final int NONACTIVATING = 1 << 24;
     static final int IS_DIALOG = 1 << 25;
     static final int IS_MODAL = 1 << 26;
     static final int IS_POPUP = 1 << 27;
+    static final int DARK_TITLE_BAR = 1 << 28;
 
     static final int _STYLE_PROP_BITMASK = DECORATED | TEXTURED | UNIFIED | UTILITY | HUD | SHEET | CLOSEABLE | MINIMIZABLE | RESIZABLE;
 
     // corresponds to method-based properties
     static final int HAS_SHADOW = 1 << 10;

@@ -228,11 +230,14 @@
                 return;
             }
 
             final String filename = ((java.io.File)value).getAbsolutePath();
             c.execute(ptr->nativeSetNSWindowRepresentedFilename(ptr, filename));
-        }}
+        }},
+        new Property<CPlatformWindow>(WINDOW_DARK_APPEARANCE) { public void applyProperty(final CPlatformWindow c, final Object value) {
+            c.setStyleBits(DARK_TITLE_BAR, value == null ? true : Boolean.parseBoolean(value.toString()));
+        }},
     }) {
         @SuppressWarnings("deprecation")
         public CPlatformWindow convertJComponentToTarget(final JRootPane p) {
             Component root = SwingUtilities.getRoot(p);
             final ComponentAccessor acc = AWTAccessor.getComponentAccessor();

@@ -466,10 +471,15 @@
 
             prop = rootpane.getClientProperty(WINDOW_DRAGGABLE_BACKGROUND);
             if (prop != null) {
                 styleBits = SET(styleBits, DRAGGABLE_BACKGROUND, Boolean.parseBoolean(prop.toString()));
             }
+
+            prop = rootpane.getClientProperty(WINDOW_DARK_APPEARANCE);
+            if (prop != null) {
+               styleBits = SET(styleBits, DARK_TITLE_BAR, Boolean.parseBoolean(prop.toString()));
+            }
         }
 
         if (isDialog) {
             styleBits = SET(styleBits, IS_DIALOG, true);
             if (((Dialog) target).isModal()) {
< prev index next >