From 0659d793a215a04bcfc5458521a06b51f6d8d380 Mon Sep 17 00:00:00 2001 From: David Catmull Date: Wed, 15 Jun 2011 21:42:29 -0600 Subject: [PATCH] split pane --- PBStashContentController.h | 3 +- PBStashContentController.m | 17 ++- PBStashContentView.xib | 283 ++++++++++++++++++++++++++++--------- 3 files changed, 232 insertions(+), 71 deletions(-) diff --git a/PBStashContentController.h b/PBStashContentController.h index 5ce1510..adf50ec 100644 --- a/PBStashContentController.h +++ b/PBStashContentController.h @@ -15,7 +15,8 @@ // Controls the view displaying a stash diff @interface PBStashContentController : PBViewController { IBOutlet id webView; - IBOutlet PBWebStashController *webController; + IBOutlet PBWebStashController *unstagedController; + IBOutlet PBWebStashController *stagedController; } - (void) showStash:(PBGitStash*)stash; diff --git a/PBStashContentController.m b/PBStashContentController.m index e6a3fe3..da0b2f4 100644 --- a/PBStashContentController.m +++ b/PBStashContentController.m @@ -11,11 +11,14 @@ #import "PBGitDefaults.h" #import "PBGitStash.h" +const CGFloat kMinPaneSize = 32.0; + @implementation PBStashContentController - (void) awakeFromNib { - [webController setRepository:repository]; + [unstagedController setRepository:repository]; + [stagedController setRepository:repository]; } - (void) showStash:(PBGitStash*)stash @@ -24,7 +27,17 @@ NSString *stashSha = [repository shaForRef:[PBGitRef refFromString:stashRef]]; PBGitCommit *commit = [PBGitCommit commitWithRepository:repository andSha:stashSha]; - [webController changeContentTo:commit]; + [unstagedController changeContentTo:commit]; +} + +- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex +{ + return kMinPaneSize; +} + +- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex +{ + return [splitView frame].size.height - kMinPaneSize; } @end diff --git a/PBStashContentView.xib b/PBStashContentView.xib index 5230212..223b589 100644 --- a/PBStashContentView.xib +++ b/PBStashContentView.xib @@ -3,7 +3,7 @@ 1060 10J869 - 851 + 788 1038.35 461.00 @@ -15,18 +15,18 @@ YES - 851 - 851 + 788 + 788 YES - + YES - com.apple.WebKitIBPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin YES @@ -53,64 +53,110 @@ 274 YES - + 274 - + YES - - YES - Apple HTML pasteboard type - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple URL pasteboard type - Apple Web Archive pasteboard type - NSColor pasteboard type - NSFilenamesPboardType - NSStringPboardType - NeXT RTFD pasteboard type - NeXT Rich Text Format v1.0 pasteboard type - NeXT TIFF v4.0 pasteboard type - WebURLsWithTitlesPboardType - public.png - public.url - public.url-name + + + 274 + + YES + + YES + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple URL pasteboard type + Apple Web Archive pasteboard type + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + WebURLsWithTitlesPboardType + public.png + public.url + public.url-name + + + {480, 272} + + + + + + + + YES + + YES + WebKitDefaultFixedFontSize + WebKitDefaultFontSize + WebKitMinimumFontSize + + + YES + + + + + + + YES + YES + + + + 274 + + YES + + YES + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple URL pasteboard type + Apple Web Archive pasteboard type + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + WebURLsWithTitlesPboardType + public.png + public.url + public.url-name + + + {{0, 282}, {480, 272}} + + + + + + YES + YES - {480, 272} + {480, 554} - - - - - - - YES - - YES - WebKitDefaultFixedFontSize - WebKitDefaultFontSize - WebKitMinimumFontSize - - - YES - - - - - - - YES - YES + 3 - {480, 272} + {480, 554} NSView PBWebStashController + + PBWebStashController + @@ -147,14 +193,6 @@ 7 - - - webController - - - - 8 - view @@ -179,6 +217,70 @@ 11 + + + unstagedController + + + + 12 + + + + stashController + + + + 15 + + + + stagedController + + + + 16 + + + + view + + + + 22 + + + + frameLoadDelegate + + + + 23 + + + + policyDelegate + + + + 24 + + + + UIDelegate + + + + 25 + + + + delegate + + + + 26 + @@ -212,20 +314,42 @@ YES - + Stash - - 2 - - - 3 + Unstaged Controller + + + 13 + + + Staged Controller + + + 21 + + + YES + + + + + + + 2 + + + + + 17 + + @@ -240,6 +364,9 @@ 1.IBPluginDependency 1.WindowOrigin 1.editorWindowContentRectSynchronizationRect + 13.IBPluginDependency + 17.IBPluginDependency + 17.IBViewBoundsToFrameTransform 2.IBPluginDependency 2.IBViewBoundsToFrameTransform 3.IBPluginDependency @@ -249,10 +376,15 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{14, 862}, {480, 272}} + {{786, 804}, {480, 554}} com.apple.InterfaceBuilder.CocoaPlugin {628, 654} {{357, 416}, {480, 272}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin + + AUJwAABCFAAAA + com.apple.WebKitIBPlugin AUJwAABCFAAAA @@ -276,7 +408,7 @@ - 11 + 26 @@ -303,12 +435,14 @@ YES YES - webController + stagedController + unstagedController webView YES PBWebStashController + PBWebStashController id @@ -316,13 +450,18 @@ YES YES - webController + stagedController + unstagedController webView YES - webController + stagedController + PBWebStashController + + + unstagedController PBWebStashController @@ -968,6 +1107,14 @@ AppKit.framework/Headers/NSSearchField.h + + NSSplitView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSSplitView.h + + NSTextField NSControl