mirror of
https://github.com/textmate/textmate.git
synced 2026-01-22 05:07:54 -05:00
Add to existing content view instead of replacing it
The window border drawing seems to be done by the root content view so it’s best to keep it around (as it may also do other things that we are unaware of).
This commit is contained in:
@@ -254,7 +254,6 @@ namespace
|
||||
self.window = [[NSWindow alloc] initWithContentRect:NSZeroRect styleMask:(NSTitledWindowMask|NSClosableWindowMask|NSResizableWindowMask|NSMiniaturizableWindowMask|NSTexturedBackgroundWindowMask) backing:NSBackingStoreBuffered defer:NO];
|
||||
self.window.autorecalculatesKeyViewLoop = YES;
|
||||
self.window.collectionBehavior = NSWindowCollectionBehaviorFullScreenPrimary;
|
||||
self.window.contentView = self.layoutView;
|
||||
self.window.delegate = self;
|
||||
self.window.releasedWhenClosed = NO;
|
||||
[self.window setContentBorderThickness:0 forEdge:NSMaxYEdge]; // top border
|
||||
@@ -262,6 +261,11 @@ namespace
|
||||
[self.window setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge];
|
||||
[self.window setAutorecalculatesContentBorderThickness:NO forEdge:NSMinYEdge];
|
||||
|
||||
[self.layoutView setTranslatesAutoresizingMaskIntoConstraints:NO];
|
||||
[self.window.contentView addSubview:self.layoutView];
|
||||
[self.window.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[view]|" options:0 metrics:nil views:@{ @"view" : self.layoutView }]];
|
||||
[self.window.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[view]|" options:0 metrics:nil views:@{ @"view" : self.layoutView }]];
|
||||
|
||||
[OakWindowFrameHelper windowFrameHelperWithWindow:self.window];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userDefaultsDidChange:) name:NSUserDefaultsDidChangeNotification object:[NSUserDefaults standardUserDefaults]];
|
||||
|
||||
Reference in New Issue
Block a user