Use auto layout to calculate the preferences window size.
This commit is contained in:
1 parent
d468777f72
commit
02b7aad97b
3 files changed
+38
-24
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user