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 90: 7dc20867e284
parent 89: 67f875241bff
branch: default
Split View - Fix to uncollapse manually collapsed pane to correct size
Bran...@marketcircle.com
13 months ago

Changed (Δ310 bytes):

raw changeset »

BWSplitView.m (16 lines added, 6 lines removed)

Up to file-list BWSplitView.m:

@@ -486,6 +486,22 @@ static float scaleFactor = 1.0f;
486
486
	[self performSelector:@selector(resizeAndAdjustSubviews) withObject:nil afterDelay:[self animationDuration]];
487
487
}
488
488
489
#pragma mark Mouse Tracking Methods
490
491
- (void)mouseDown:(NSEvent *)theEvent
492
{
493
	// Set the uncollapsed size whenever the split view is clicked or a drag has began. This lets us uncollapse to the size of the subview before the drag-collapse.
494
	if ([self hasCollapsibleSubview])
495
	{
496
		CGFloat collapsibleViewSize = [self isVertical] ?  [self collapsibleSubview].frame.size.width : [self collapsibleSubview].frame.size.height;
497
	
498
		if (!isAnimating && collapsibleViewSize > 0)
499
			uncollapsedSize = collapsibleViewSize;
500
	}
501
502
	[super mouseDown:theEvent];
503
}
504
489
505
#pragma mark NSSplitView Delegate Methods
490
506
491
507
- (BOOL)splitView:(NSSplitView *)splitView shouldHideDividerAtIndex:(NSInteger)dividerIndex
@@ -669,12 +685,6 @@ static float scaleFactor = 1.0f;
669
685
670
686
- (void)splitViewDidResizeSubviews:(NSNotification *)aNotification
671
687
{
672
	CGFloat collapsibleViewSize = [self isVertical] ?  [self collapsibleSubview].frame.size.width : [self collapsibleSubview].frame.size.height;
673
	if (!isAnimating && collapsibleViewSize > 0) 
674
	{
675
		uncollapsedSize = collapsibleViewSize;
676
	}
677
678
688
	if (collapsibleSubviewCollapsed && ([self isVertical] ? [[self collapsibleSubview] frame].size.width > 0 : [[self collapsibleSubview] frame].size.height > 0))
679
689
	{
680
690
		[self setCollapsibleSubviewCollapsed:NO];