diff options
author | rowanbeentje <rowan@beent.je> | 2012-07-24 01:27:44 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2012-07-24 01:27:44 +0000 |
commit | a531651aac81aaa89e2c292be7f9273d8b629373 (patch) | |
tree | b1a1bc7891a19d4de9dd1dd31dcf715ed1e5090b /Source/SPSplitView.m | |
parent | 2c797dd704b29331dfd2704ba48f29792f6f49dd (diff) | |
download | sequelpro-a531651aac81aaa89e2c292be7f9273d8b629373.tar.gz sequelpro-a531651aac81aaa89e2c292be7f9273d8b629373.tar.bz2 sequelpro-a531651aac81aaa89e2c292be7f9273d8b629373.zip |
- Replace the main split view in the main view with a SPSplitView, replacing the anchored button bar and buttons with normal equivalents.
- Make the main split view collapsbile to avoid resize issues with the filter box
- Fix problems with additional drag handles in SPSplitView when one of the views was using flipped coordinates
- Fix problems with manually dragged uncollapses in SPSplitView
- Fix problems instantiating SPSplitView instances on 10.5 (with thanks to schlabberdog)
Diffstat (limited to 'Source/SPSplitView.m')
-rw-r--r-- | Source/SPSplitView.m | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/SPSplitView.m b/Source/SPSplitView.m index 51e3eb79..8d25167e 100644 --- a/Source/SPSplitView.m +++ b/Source/SPSplitView.m @@ -92,7 +92,7 @@ - (void)awakeFromNib { - if ([super respondsToSelector:@selector(awakeFromNib)]) { + if ([NSSplitView instancesRespondToSelector:@selector(awakeFromNib)]) { [super awakeFromNib]; } @@ -598,6 +598,9 @@ if (additionalDragHandleView) { NSRect dragRect = [additionalDragHandleView frame]; dragRect.origin = [self convertPoint:dragRect.origin fromView:[additionalDragHandleView superview]]; + if ([additionalDragHandleView isFlipped] != [self isFlipped]) { + dragRect.origin.y -= dragRect.size.height; + } return dragRect; } @@ -761,7 +764,7 @@ if (i == collapsibleSubviewIndex && collapsibleSubviewCollapsed && !viewIsAnimating) { minSizes[i] = 0.f; maxSizes[i] = 0.f; - } else if (i == collapsibleSubviewIndex && !viewLength && animationTargetSize && [eachSubview isKindOfClass:[SPSplitViewHelperView class]]) { + } else if (i == collapsibleSubviewIndex && !viewLength && animationTargetSize && !viewIsAnimating && [eachSubview isKindOfClass:[SPSplitViewHelperView class]]) { minSizes[i] = animationTargetSize; maxSizes[i] = animationTargetSize; } else if (respectStruts && ![self _isViewResizable:eachSubview]) { @@ -778,6 +781,12 @@ // If this isn't the collapsible subview, or if there's no collapse animation, measure // the view and continue. if (!viewIsAnimating) { + + // Restore the original view if necessary + if ([eachSubview isKindOfClass:[SPSplitViewHelperView class]] && !collapsibleSubviewCollapsed && (viewLength || animationTargetSize)) { + [(SPSplitViewHelperView *)eachSubview restoreOriginalView]; + } + originalSizes[i] = viewLength; totalCurrentSize += viewLength; [outputSizes addObject:[NSNumber numberWithFloat:viewLength]]; |