Use auto layout to calculate the preferences window size.

This commit is contained in:
Damiano Galassi committed 2016-08-06 12:46:54 +02:00
1 parent d468777f72
commit 02b7aad97b
3 files changed
+38 -24

No files matched your search

+12 -8
View File
@@ -208,15 +208,19 @@
return;
}
NSRect windowRect = window.frame;
CGFloat difference = (view.frame.size.height - window.contentView.frame.size.height);
windowRect.origin.y -= difference;
windowRect.size.height += difference;
view.hidden = YES;
window.contentView = view;
[window setFrame:windowRect display:YES animate:YES];
view.hidden = NO;
if (window.isVisible) {
view.hidden = YES;
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
context.allowsImplicitAnimation = YES;
[window layoutIfNeeded];
} completionHandler:^{
view.hidden = NO;
}];
}
// Set title label
if (sender) {