aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-07-30 20:04:10 +0000
committerrowanbeentje <rowan@beent.je>2012-07-30 20:04:10 +0000
commited16bf078249b4b474a231ba487702f4f7d9a13b (patch)
tree52a6b0bb364acca7cc62904bdfbe771b5978242d
parent62621d6fde334a8b61f43925d65c754860db9a5a (diff)
downloadsequelpro-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
-rw-r--r--Interfaces/English.lproj/BundleEditor.xib33
-rw-r--r--Source/SPBundleEditorController.m15
-rw-r--r--Source/SPSplitView.m64
3 files changed, 51 insertions, 61 deletions
diff --git a/Interfaces/English.lproj/BundleEditor.xib b/Interfaces/English.lproj/BundleEditor.xib
index be24d2c3..95b7d07c 100644
--- a/Interfaces/English.lproj/BundleEditor.xib
+++ b/Interfaces/English.lproj/BundleEditor.xib
@@ -23,6 +23,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="683"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -62,7 +63,7 @@
<string key="NSWindowContentMaxSize">{1.7976931348623157e+308, 1.7976931348623157e+308}</string>
<string key="NSWindowContentMinSize">{730, 494}</string>
<object class="NSView" key="NSWindowView" id="391663674">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -73,7 +74,7 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSView" id="69213598">
<reference key="NSNextResponder" ref="358491109"/>
- <int key="NSvFlags">274</int>
+ <int key="NSvFlags">272</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSImageView" id="890728542">
@@ -412,6 +413,7 @@
</object>
<string key="NSFrame">{{1, 1}, {143, 528}}</string>
<reference key="NSSuperview" ref="802985400"/>
+ <reference key="NSNextKeyView" ref="472206854"/>
<reference key="NSDocView" ref="472206854"/>
<reference key="NSBGColor" ref="255000212"/>
<int key="NScvFlags">4</int>
@@ -438,6 +440,7 @@
</object>
<string key="NSFrame">{{-2, 23}, {145, 530}}</string>
<reference key="NSSuperview" ref="69213598"/>
+ <reference key="NSNextKeyView" ref="34907435"/>
<int key="NSsFlags">133650</int>
<reference key="NSVScroller" ref="769403162"/>
<reference key="NSHScroller" ref="124076675"/>
@@ -490,6 +493,29 @@
<object class="NSTextView" id="256802597">
<reference key="NSNextResponder" ref="148424706"/>
<int key="NSvFlags">2322</int>
+ <object class="NSMutableSet" key="NSDragTypes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="set.sortedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>Apple HTML pasteboard type</string>
+ <string>Apple PDF pasteboard type</string>
+ <string>Apple PICT pasteboard type</string>
+ <string>Apple PNG pasteboard type</string>
+ <string>Apple URL pasteboard type</string>
+ <string>CorePasteboardFlavorType 0x6D6F6F76</string>
+ <string>NSColor pasteboard type</string>
+ <string>NSFilenamesPboardType</string>
+ <string>NSStringPboardType</string>
+ <string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
+ <string>NeXT RTFD pasteboard type</string>
+ <string>NeXT Rich Text Format v1.0 pasteboard type</string>
+ <string>NeXT TIFF v4.0 pasteboard type</string>
+ <string>NeXT font pasteboard type</string>
+ <string>NeXT ruler pasteboard type</string>
+ <string>WebURLsWithTitlesPboardType</string>
+ <string>public.url</string>
+ </object>
+ </object>
<string key="NSFrameSize">{715, 289}</string>
<reference key="NSSuperview" ref="148424706"/>
<object class="NSTextContainer" key="NSTextContainer" id="199092126">
@@ -573,6 +599,7 @@
</object>
<string key="NSFrame">{{1, 1}, {715, 289}}</string>
<reference key="NSSuperview" ref="221738058"/>
+ <reference key="NSNextKeyView" ref="256802597"/>
<reference key="NSDocView" ref="256802597"/>
<reference key="NSBGColor" ref="856229010"/>
<object class="NSCursor" key="NSCursor" id="873465698">
@@ -604,6 +631,7 @@
</object>
<string key="NSFrame">{{20, 52}, {717, 291}}</string>
<reference key="NSSuperview" ref="338542681"/>
+ <reference key="NSNextKeyView" ref="148424706"/>
<int key="NSsFlags">133650</int>
<reference key="NSVScroller" ref="881611086"/>
<reference key="NSHScroller" ref="877826884"/>
@@ -1196,6 +1224,7 @@
</object>
</object>
<string key="NSFrameSize">{900, 550}</string>
+ <reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMinSize">{730, 516}</string>
diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m
index e94303fb..a23c3183 100644
--- a/Source/SPBundleEditorController.m
+++ b/Source/SPBundleEditorController.m
@@ -1213,21 +1213,6 @@
}
#pragma mark -
-#pragma mark Split view delegates
-
-- (void)splitView:(NSSplitView *)theSplitView resizeSubviewsWithOldSize:(NSSize)oldSize
-{
- NSView *nonResizableSubview = [[theSplitView subviews] objectAtIndex:0];
- NSView *resizableSubview = [[theSplitView subviews] objectAtIndex:1];
-
- CGFloat nonResizableSubviewTotal = [nonResizableSubview frame].size.width;
- nonResizableSubviewTotal += [theSplitView dividerThickness];
-
- [nonResizableSubview setFrameSize:NSMakeSize([nonResizableSubview frame].size.width, [splitView frame].size.height)];
- [resizableSubview setFrameSize:NSMakeSize([theSplitView frame].size.width - nonResizableSubviewTotal, [splitView frame].size.height)];
-}
-
-#pragma mark -
#pragma mark TableView delegates
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
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);