Skip to content

Commit 62c0c60

Browse files
authored
Merge pull request #1089 from sfsam/resizeprefs
Properly size General pane when DISABLE_SPARKLE=1
2 parents 0547968 + 5ab1544 commit 62c0c60

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

src/MacVim/MMPreferenceController.m

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,31 @@ static void loadSymbols()
4747

4848
@implementation MMPreferenceController
4949

50+
- (void)windowDidLoad
51+
{
52+
#if DISABLE_SPARKLE
53+
// If Sparkle is disabled in config, we don't want to show the preference pane
54+
// which could be confusing as it won't do anything.
55+
// After hiding the Sparkle subview, shorten the height of the General pane
56+
// and move its other subviews down.
57+
[sparkleUpdaterPane setHidden:YES];
58+
CGFloat sparkleHeight = NSHeight(sparkleUpdaterPane.frame);
59+
NSRect frame = generalPreferences.frame;
60+
frame.size.height -= sparkleHeight;
61+
generalPreferences.frame = frame;
62+
for (NSView *subview in generalPreferences.subviews) {
63+
frame = subview.frame;
64+
frame.origin.y -= sparkleHeight;
65+
subview.frame = frame;
66+
}
67+
#endif
68+
[super windowDidLoad];
69+
}
70+
5071
- (IBAction)showWindow:(id)sender
5172
{
5273
[super setCrossFade:NO];
5374
[super showWindow:sender];
54-
#if DISABLE_SPARKLE
55-
// If Sparkle is disabled in config, we don't want to show the preference pane
56-
// which could be confusing as it won't do anything.
57-
[sparkleUpdaterPane setHidden:YES];
58-
#endif
5975
}
6076

6177
- (void)setupToolbar

0 commit comments

Comments
 (0)