Resolve ambiguous autolayout issues

Most of these layout changes are related to the common pattern we used to set constraints for "dividers", where one of the dividers is specified to be connected to both edges of its superview then setting the other dividers' constraints to have equal widths (e.g., @"H:|[divider(==divider2,==divider3)]"). On 10.12, this now appears to result in ambiguous layout. We can resolve it by connecting at least one of the edges for each divider to its superview.
This commit is contained in:
Ronald Wampler
2017-04-11 22:01:29 -04:00
committed by Allan Odgaard
parent a124b494c2
commit f3cd0b0797
12 changed files with 85 additions and 24 deletions

View File

@@ -51,7 +51,7 @@ static void ShowLoadErrorForURL (WebFrame* frame, NSURL* url, NSError* error)
OakAddAutoLayoutViewsToSuperview([views allValues], self);
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[webView(==statusBar,==divider)]|" options:NSLayoutFormatAlignAllTop metrics:nil views:views]];
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[webView(==statusBar,==divider)]|" options:NSLayoutFormatAlignAllTop metrics:nil views:views]];
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[webView(>=10)][divider][statusBar]|" options:NSLayoutFormatAlignAllLeading metrics:nil views:views]];
}
return self;

View File

@@ -106,7 +106,7 @@ static NSTextField* OakCreateTextField ()
NSArray* layout = @[
@"H:|-(3)-[back(==22)]-(2)-[forward(==back)]-(2)-[divider]",
@"V:|[back(==forward,==divider)]|",
@"V:|[back(==forward,==divider)]|", @"V:|[forward]|", @"V:|[divider]|",
@"V:[status]-5-|",
];