diff --git a/MacPass/Base.lproj/InspectorView.xib b/MacPass/Base.lproj/InspectorView.xib index f2f74fa3..308c7acd 100644 --- a/MacPass/Base.lproj/InspectorView.xib +++ b/MacPass/Base.lproj/InspectorView.xib @@ -1,8 +1,8 @@ - + - + @@ -200,7 +200,7 @@ - + diff --git a/MacPass/MPDocumentSplitViewController.m b/MacPass/MPDocumentSplitViewController.m index 4374aaa4..37e6730a 100644 --- a/MacPass/MPDocumentSplitViewController.m +++ b/MacPass/MPDocumentSplitViewController.m @@ -17,6 +17,7 @@ @property (strong) MPEntryViewController *entryViewController; @property (strong) MPOutlineViewController *outlineViewController; @property (strong) MPInspectorViewController *inspectorViewController; +@property (strong) NSLayoutConstraint *inspectorTopEdgeConstraint; @end @@ -39,6 +40,28 @@ - (void)viewWillLayout { self.splitView.autosaveName = @"SplitView"; + [super viewWillLayout]; +} + +- (void)updateViewConstraints { + [super updateViewConstraints]; + if(self.inspectorTopEdgeConstraint) { + if(!self.inspectorTopEdgeConstraint.isActive) { + self.inspectorTopEdgeConstraint.active = YES; + } + return; // everything is set up. + } + /* setup the constraint if needed */ + NSWindow *window = self.view.window; + if(!window) { + return; + } + NSSplitViewItem *inspector = [self splitViewItemForViewController:self.inspectorViewController]; + if(inspector) { + self.inspectorTopEdgeConstraint = [NSLayoutConstraint constraintWithItem:inspector.viewController.view attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:window.contentLayoutGuide attribute:NSLayoutAttributeTop multiplier:1 constant:0]; + + self.inspectorTopEdgeConstraint.active = YES; + } } - (void)viewDidLoad { @@ -61,7 +84,7 @@ [self addSplitViewItem:outlineItem]; [self addSplitViewItem:entries]; [self addSplitViewItem:inspector]; - + BOOL showInspector = [NSUserDefaults.standardUserDefaults boolForKey:kMPSettingsKeyShowInspector]; inspector.collapsed = !showInspector; } diff --git a/MacPass/MPDocumentWindowController.m b/MacPass/MPDocumentWindowController.m index 39af01fc..d8854947 100644 --- a/MacPass/MPDocumentWindowController.m +++ b/MacPass/MPDocumentWindowController.m @@ -100,6 +100,7 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword); [super windowDidLoad]; self.window.delegate = self.documentWindowDelegate; + self.window.styleMask |= NSWindowStyleMaskFullSizeContentView; [self.window registerForDraggedTypes:@[NSURLPboardType]]; MPDocument *document = self.document;