Fixed occasional “too light” title bar gradient

This would mainly happen when creating new windows with a file browser.

Described at:
http://stackoverflow.com/questions/5812593/nswindow-textured-gradient-fill-weirdness
http://stackoverflow.com/questions/7795505/nswindow-textured-background-with-nstextfield/11482772#11482772
This commit is contained in:
Adam Strzelecki
2013-01-30 00:28:19 +01:00
committed by Allan Odgaard
parent 5f69592a1f
commit 08d8d69f2e

View File

@@ -240,6 +240,10 @@ namespace
self.window.contentView = self.layoutView;
self.window.delegate = self;
self.window.releasedWhenClosed = NO;
[self.window setContentBorderThickness:0 forEdge:NSMaxYEdge]; // top border
[self.window setContentBorderThickness:0 forEdge:NSMinYEdge]; // bottom border
[self.window setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge];
[self.window setAutorecalculatesContentBorderThickness:NO forEdge:NSMinYEdge];
[self.window bind:@"title" toObject:self withKeyPath:@"windowTitle" options:nil];
[self.window bind:@"documentEdited" toObject:self withKeyPath:@"isDocumentEdited" options:nil];