aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/SPConnectionController.h2
-rw-r--r--Source/SPConnectionController.m2
-rw-r--r--Source/SPConnectionControllerDelegate.m27
-rw-r--r--Source/SPDatabaseDocument.m15
4 files changed, 10 insertions, 36 deletions
diff --git a/Source/SPConnectionController.h b/Source/SPConnectionController.h
index 86167a91..672e983f 100644
--- a/Source/SPConnectionController.h
+++ b/Source/SPConnectionController.h
@@ -32,7 +32,7 @@
@interface NSObject (BWAnchoredButtonBar)
-- (void)setSplitViewDelegate:(id)splitViewDelegate;
+- (NSRect)splitView:(NSSplitView *)splitView additionalEffectiveRectOfDividerAtIndex:(NSInteger)dividerIndex;
@end
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index 4e8338aa..e22719de 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -113,7 +113,7 @@
[connectionView setFrame:[databaseConnectionView frame]];
[databaseConnectionSuperview addSubview:connectionView];
[connectionSplitView setPosition:[[tableDocument valueForKey:@"dbTablesTableView"] frame].size.width-6 ofDividerAtIndex:0];
- [connectionSplitViewButtonBar setSplitViewDelegate:self];
+ [connectionSplitView setDelegate:self];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(scrollViewFrameChanged:) name:NSViewFrameDidChangeNotification object:nil];
// Set up a keychain instance and preferences reference, and create the initial favorites list
diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m
index 6bb0ee47..665119da 100644
--- a/Source/SPConnectionControllerDelegate.m
+++ b/Source/SPConnectionControllerDelegate.m
@@ -110,33 +110,18 @@
#pragma mark -
#pragma mark SplitView delegate methods
-/**
- * When the split view is resized, trigger a resize in the hidden table
- * width as well, to keep the connection view and connected view in synch.
- * Use this rather than splitViewDidResizeSubviews: as the latter is not
- * forwarded by the BWAnchoredButtonBar.
- */
-- (CGFloat)splitView:(NSSplitView *)splitView constrainSplitPosition:(CGFloat)proposedPosition ofSubviewAt:(NSInteger)dividerIndex
-{
- [databaseConnectionView setPosition:[[[connectionSplitView subviews] objectAtIndex:0] frame].size.width ofDividerAtIndex:0];
-
- return proposedPosition;
-}
-
-/**
- * Return the maximum possible size of the splitview.
- */
-- (CGFloat)splitView:(NSSplitView *)sender constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)offset
+- (NSRect)splitView:(NSSplitView *)splitView additionalEffectiveRectOfDividerAtIndex:(NSInteger)dividerIndex
{
- return (proposedMax - 445);
+ return [connectionSplitViewButtonBar splitView:splitView additionalEffectiveRectOfDividerAtIndex:dividerIndex];
}
/**
- * Return the minimum possible size of the splitview.
+ * When the split view is resized, trigger a resize in the hidden table
+ * width as well, to keep the connection view and connected view in synch.
*/
-- (CGFloat)splitView:(NSSplitView *)sender constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)offset
+- (void)splitViewDidResizeSubviews:(NSNotification *)aNotification
{
- return (proposedMin + 80);
+ [databaseConnectionView setPosition:[[[connectionSplitView subviews] objectAtIndex:0] frame].size.width ofDividerAtIndex:0];
}
#pragma mark -
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 1e568fec..b6979dfa 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -5267,16 +5267,6 @@ YY_BUFFER_STATE yy_scan_string (const char *);
#pragma mark -
#pragma mark SplitView delegate methods
-- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex
-{
-
- // Limit the right view of DBViewSplitter in order to avoid GUI element overlapping
- if(splitView == contentViewSplitter) return proposedMax - 495;
-
- return proposedMax;
-
-}
-
/**
* tells the splitView that it can collapse views
*/
@@ -5296,9 +5286,8 @@ YY_BUFFER_STATE yy_scan_string (const char *);
- (NSRect)splitView:(NSSplitView *)splitView additionalEffectiveRectOfDividerAtIndex:(NSInteger)dividerIndex
{
- if (sidebarGrabber != nil) {
- NSRect grabberBounds = [sidebarGrabber bounds];
- return [sidebarGrabber convertRect:NSMakeRect(grabberBounds.origin.x + (grabberBounds.size.width - 16), grabberBounds.origin.y, 16, grabberBounds.size.height) toView:splitView];
+ if (splitView == contentViewSplitter && sidebarGrabber != nil) {
+ return [sidebarGrabber splitView:splitView additionalEffectiveRectOfDividerAtIndex:dividerIndex];
} else {
return NSZeroRect;
}