Skip to content

Commit 0659d79

Browse files
David CatmullDavid Catmull
authored andcommitted
split pane
1 parent 4a2c139 commit 0659d79

File tree

3 files changed

+228
-67
lines changed

3 files changed

+228
-67
lines changed

PBStashContentController.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
// Controls the view displaying a stash diff
1616
@interface PBStashContentController : PBViewController {
1717
IBOutlet id webView;
18-
IBOutlet PBWebStashController *webController;
18+
IBOutlet PBWebStashController *unstagedController;
19+
IBOutlet PBWebStashController *stagedController;
1920
}
2021

2122
- (void) showStash:(PBGitStash*)stash;

PBStashContentController.m

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@
1111
#import "PBGitDefaults.h"
1212
#import "PBGitStash.h"
1313

14+
const CGFloat kMinPaneSize = 32.0;
15+
1416
@implementation PBStashContentController
1517

1618
- (void) awakeFromNib
1719
{
18-
[webController setRepository:repository];
20+
[unstagedController setRepository:repository];
21+
[stagedController setRepository:repository];
1922
}
2023

2124
- (void) showStash:(PBGitStash*)stash
@@ -24,7 +27,17 @@ - (void) showStash:(PBGitStash*)stash
2427
NSString *stashSha = [repository shaForRef:[PBGitRef refFromString:stashRef]];
2528
PBGitCommit *commit = [PBGitCommit commitWithRepository:repository andSha:stashSha];
2629

27-
[webController changeContentTo:commit];
30+
[unstagedController changeContentTo:commit];
31+
}
32+
33+
- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex
34+
{
35+
return kMinPaneSize;
36+
}
37+
38+
- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex
39+
{
40+
return [splitView frame].size.height - kMinPaneSize;
2841
}
2942

3043
@end

0 commit comments

Comments
 (0)