Removed fill size window content to fix a lot of toolbar issues

This commit is contained in:
Michael Starke
2021-01-05 15:05:22 +01:00
parent d22750fefc
commit 15dce5f0b6
3 changed files with 12 additions and 14 deletions

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17701"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -13,9 +13,8 @@
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="Hz6-mo-xeY">
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Hz6-mo-xeY">
<rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<point key="canvasLocation" x="141" y="154"/>
</customView>
</objects>

View File

@@ -17,7 +17,6 @@
@property (strong) MPEntryViewController *entryViewController;
@property (strong) MPOutlineViewController *outlineViewController;
@property (strong) MPInspectorViewController *inspectorViewController;
@property (strong) NSLayoutConstraint *inspectorTopEdgeConstraint;
@end
@@ -43,7 +42,7 @@
[super viewWillLayout];
}
- (void)updateViewConstraints {
/*- (void)updateViewConstraints {
[super updateViewConstraints];
if(self.inspectorTopEdgeConstraint) {
if(!self.inspectorTopEdgeConstraint.isActive) {
@@ -51,18 +50,18 @@
}
return; // everything is set up.
}
/* setup the constraint if needed */
// 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;
}
}
NSSplitViewItem *entries = [self splitViewItemForViewController:self.entryViewController];
NSSplitViewItem *outline = [self splitViewItemForViewController:self.outlineViewController];
[inspector.viewController.view.topAnchor constraintEqualToAnchor:[window.contentLayoutGuide topAnchor]].active = YES;
[entries.viewController.view.topAnchor constraintEqualToAnchor:[window.contentLayoutGuide topAnchor]].active = YES;
[outline.viewController.view.topAnchor constraintEqualToAnchor:[window.contentLayoutGuide topAnchor]].active = YES;
}*/
- (void)viewDidLoad {
[super viewDidLoad];

View File

@@ -100,7 +100,7 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
[super windowDidLoad];
self.window.delegate = self.documentWindowDelegate;
self.window.styleMask |= NSWindowStyleMaskFullSizeContentView;
//self.window.styleMask |= NSWindowStyleMaskFullSizeContentView;
if (@available(macOS 11.0, *)) {
self.window.toolbarStyle = NSWindowToolbarStyleExpanded;
}