bwalkin / BWToolkit (http://brandonwalkin.com/bwtoolkit/)

BWToolkit is an Interface Builder plugin that contains commonly used UI elements and other objects designed to simplify development for the Mac.

Clone this repository (size: 1.5 MB): HTTPS / SSH
$ hg clone http://bitbucket.org/bwalkin/bwtoolkit
commit 92: e45b8c434e32
parent 91: 2e67517c4c17
branch: default
Split View - Fixed bug where a pane could autoresize its subviews while collapsing or expanding
Bran...@marketcircle.com
13 months ago

Changed (Δ593 bytes):

raw changeset »

BWSplitView.m (11 lines added, 0 lines removed)

Up to file-list BWSplitView.m:

@@ -347,6 +347,11 @@ static float scaleFactor = 1.0f;
347
347
	}
348
348
}
349
349
350
- (void)restoreAutoresizesSubviews:(NSNumber *)flag
351
{
352
	[[self collapsibleSubview] setAutoresizesSubviews:[flag boolValue]];
353
}
354
350
355
- (IBAction)toggleCollapse:(id)sender
351
356
{
352
357
	if ([self respondsToSelector:@selector(ibDidAddToDesignableDocument:)])
@@ -394,6 +399,11 @@ static float scaleFactor = 1.0f;
394
399
	if (resizableSubview == nil)
395
400
		return;
396
401
	
402
	// Record whether the collapsible subview is set to autoresize subviews so we can restore it after the animation
403
	BOOL autoresizesSubviews = [[self collapsibleSubview] autoresizesSubviews];
404
	
405
	// Turn off autoresizesSubviews on the collapsible subview
406
	[[self collapsibleSubview] setAutoresizesSubviews:NO];
397
407
	
398
408
	// Get the thickness of the collapsible divider. If the divider cannot collapse, we set it to 0 so it doesn't affect our calculations.
399
409
	float collapsibleDividerThickness = [self dividerThickness];
@@ -485,6 +495,7 @@ static float scaleFactor = 1.0f;
485
495
	
486
496
	isAnimating = YES;
487
497
	[self performSelector:@selector(animationEnded) withObject:nil afterDelay:[self animationDuration]];
498
	[self performSelector:@selector(restoreAutoresizesSubviews:) withObject:[NSNumber numberWithBool:autoresizesSubviews] afterDelay:[self animationDuration]];
488
499
	
489
500
	[self performSelector:@selector(resizeAndAdjustSubviews) withObject:nil afterDelay:[self animationDuration]];
490
501
}