From f326ef86ab545f853ead73603c6bf6ba2d67b327 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 2 Jan 2022 12:13:18 -0500 Subject: [PATCH] Use a better method for resizing the preferences window. --- Source/PreferencesController.m | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Source/PreferencesController.m b/Source/PreferencesController.m index 092ed9f..86359b7 100644 --- a/Source/PreferencesController.m +++ b/Source/PreferencesController.m @@ -163,18 +163,8 @@ { // Hide the current view when animating, to avoid weird artifacts. self.window.contentView = _blankView; - - NSWindowStyleMask styleMask = self.window.styleMask; - NSRect newFrame = [NSWindow contentRectForFrameRect:self.window.frame styleMask:styleMask]; - - CGFloat height = size.height + 55; - newFrame.origin.y += newFrame.size.height; - newFrame.origin.y -= height; - newFrame.size.height = height; - newFrame.size.width = size.width; - - newFrame = [NSWindow frameRectForContentRect:newFrame styleMask:styleMask]; - + NSPoint origin = self.window.frame.origin; + NSRect newFrame = [self.window frameRectForContentRect:NSMakeRect(origin.x, origin.y, size.width, size.height)]; [[self window] setFrame:newFrame display:YES animate:YES]; } -- 2.43.5