diff options
author | rowanbeentje <rowan@beent.je> | 2012-07-30 20:04:10 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2012-07-30 20:04:10 +0000 |
commit | ed16bf078249b4b474a231ba487702f4f7d9a13b (patch) | |
tree | 52a6b0bb364acca7cc62904bdfbe771b5978242d /Source/SPSplitView.m | |
parent | 62621d6fde334a8b61f43925d65c754860db9a5a (diff) | |
download | sequelpro-ed16bf078249b4b474a231ba487702f4f7d9a13b.tar.gz sequelpro-ed16bf078249b4b474a231ba487702f4f7d9a13b.tar.bz2 sequelpro-ed16bf078249b4b474a231ba487702f4f7d9a13b.zip |
- Tweak SPSplitView to no longer treat non-resizable split view children as max/min constraints when dragging the splitview divider. This improves default behaviour and also allow use of the non-resizable split view children to control relative autoresizing when resizing a parent view
- Tweak Bundle Editor to no longer require split view delegate controls to control resizing, instead making the first split view child non-resizable in IB
Diffstat (limited to 'Source/SPSplitView.m')
-rw-r--r-- | Source/SPSplitView.m | 64 |
1 files changed, 20 insertions, 44 deletions
diff --git a/Source/SPSplitView.m b/Source/SPSplitView.m index d86a259e..b3c067d5 100644 --- a/Source/SPSplitView.m +++ b/Source/SPSplitView.m @@ -494,30 +494,18 @@ [self _ensureDefaultSubviewSizesToIndex:(dividerIndex + 1)]; - // If the preceeding view is not resizable, treat it as fixed position - aView = [[self subviews] objectAtIndex:dividerIndex]; - if (![self _isViewResizable:aView]) { - preMinPosition = [self _startPositionOfView:aView] + [self _lengthOfView:aView]; - } else { - - // Check the minimum size of the preceeding view - CGFloat preMinSize = [[viewMinimumSizes objectAtIndex:dividerIndex] floatValue]; - if (preMinSize) { - preMinPosition = [self _startPositionOfView:aView] + preMinSize; - } + // Check the minimum size of the preceeding view + CGFloat preMinSize = [[viewMinimumSizes objectAtIndex:dividerIndex] floatValue]; + if (preMinSize) { + aView = [[self subviews] objectAtIndex:dividerIndex]; + preMinPosition = [self _startPositionOfView:aView] + preMinSize; } - // If the following view is not resizable, treat it as fixed position - aView = [[self subviews] objectAtIndex:(dividerIndex + 1)]; - if (![self _isViewResizable:aView]) { - postMaxPosition = [self _startPositionOfView:aView] - [self dividerThickness]; - } else { - - // Check the maximum size of the following view - CGFloat postMaxSize = [[viewMaximumSizes objectAtIndex:(dividerIndex + 1)] floatValue]; - if (postMaxSize != FLT_MAX) { - postMaxPosition = [self _startPositionOfView:aView] + [self _lengthOfView:aView] - postMaxSize - [self dividerThickness]; - } + // Check the maximum size of the following view + CGFloat postMaxSize = [[viewMaximumSizes objectAtIndex:(dividerIndex + 1)] floatValue]; + if (postMaxSize != FLT_MAX) { + aView = [[self subviews] objectAtIndex:(dividerIndex + 1)]; + postMaxPosition = [self _startPositionOfView:aView] + [self _lengthOfView:aView] - postMaxSize - [self dividerThickness]; } CGFloat suggestedMinimum = fmaxf(preMinPosition, postMaxPosition); @@ -548,30 +536,18 @@ [self _ensureDefaultSubviewSizesToIndex:(dividerIndex + 1)]; - // If the preceeding view is not resizable, treat it as fixed position - aView = [[self subviews] objectAtIndex:dividerIndex]; - if (![self _isViewResizable:aView]) { - preMaxPosition = [self _startPositionOfView:aView] + [self _lengthOfView:aView]; - } else { - - // Check the maximum size of the preceeding view - CGFloat preMaxSize = [[viewMaximumSizes objectAtIndex:dividerIndex] floatValue]; - if (preMaxSize != FLT_MAX) { - preMaxPosition = [self _startPositionOfView:aView] + preMaxSize; - } + // Check the maximum size of the preceeding view + CGFloat preMaxSize = [[viewMaximumSizes objectAtIndex:dividerIndex] floatValue]; + if (preMaxSize != FLT_MAX) { + aView = [[self subviews] objectAtIndex:dividerIndex]; + preMaxPosition = [self _startPositionOfView:aView] + preMaxSize; } - // If the following view is not resizable, treat it as fixed position - aView = [[self subviews] objectAtIndex:(dividerIndex + 1)]; - if (![self _isViewResizable:aView]) { - postMinPosition = [self _startPositionOfView:aView] - [self dividerThickness]; - } else { - - // Check the minimum size of the following view - CGFloat postMinSize = [[viewMinimumSizes objectAtIndex:(dividerIndex + 1)] floatValue]; - if (postMinSize) { - postMinPosition = [self _startPositionOfView:aView] + [self _lengthOfView:aView] - postMinSize - [self dividerThickness]; - } + // Check the minimum size of the following view + CGFloat postMinSize = [[viewMinimumSizes objectAtIndex:(dividerIndex + 1)] floatValue]; + if (postMinSize) { + aView = [[self subviews] objectAtIndex:(dividerIndex + 1)]; + postMinPosition = [self _startPositionOfView:aView] + [self _lengthOfView:aView] - postMinSize - [self dividerThickness]; } CGFloat suggestedMaximum = fminf(preMaxPosition, postMinPosition); |