mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
working
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
}
|
||||
|
||||
@property (readonly) NSTreeController* treeController;
|
||||
@property (readonly) PBCollapsibleSplitView *historySplitView;
|
||||
@property (assign) int selectedCommitDetailsIndex;
|
||||
@property (retain) PBGitCommit *webCommit;
|
||||
@property (retain) PBGitTree* gitTree;
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
@synthesize searchController;
|
||||
@synthesize commitList;
|
||||
@synthesize treeController;
|
||||
@synthesize historySplitView;
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PBGitRepository.h"
|
||||
|
||||
#define kGitSplitViewMinWidth 150.0f
|
||||
#define kGitSplitViewMaxWidth 300.0f
|
||||
|
||||
@class PBViewController, PBGitSidebarController, PBGitCommitController;
|
||||
|
||||
@interface PBGitWindowController : NSWindowController {
|
||||
@@ -39,6 +42,7 @@
|
||||
- (void)showMessageSheet:(NSString *)messageText infoText:(NSString *)infoText;
|
||||
- (void)showErrorSheet:(NSError *)error;
|
||||
- (void)showErrorSheetTitle:(NSString *)title message:(NSString *)message arguments:(NSArray *)arguments output:(NSString *)output;
|
||||
- (void)collapseSplitView:(NSSplitView *)sp show:(BOOL)show;
|
||||
|
||||
- (IBAction) showCommitView:(id)sender;
|
||||
- (IBAction) showHistoryView:(id)sender;
|
||||
|
||||
+25
-3
@@ -217,16 +217,38 @@
|
||||
|
||||
- (IBAction) changeLayout:(id)sender{
|
||||
NSLog(@"selectedSegment=%ld (%d)",[sender selectedSegment],[sender isSelectedForSegment:[sender selectedSegment]]);
|
||||
NSSplitView *sp=nil;
|
||||
switch ([sender selectedSegment]) {
|
||||
case 0:
|
||||
sp=splitView;
|
||||
break;
|
||||
case 1:
|
||||
sp=[[sidebarController historyViewController] historySplitView];
|
||||
break;
|
||||
}
|
||||
NSLog(@"sp=%@",sp);
|
||||
if(sp!=nil) {
|
||||
[self collapseSplitView:sp show:[sender isSelectedForSegment:[sender selectedSegment]]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)collapseSplitView:(NSSplitView *)sp show:(BOOL)show{
|
||||
NSView *clipview = [[sp subviews] objectAtIndex:0];
|
||||
NSRect clipFrame = [clipview frame];
|
||||
|
||||
if ([sp isVertical]) {
|
||||
clipFrame.size.width = kGitSplitViewMinWidth * show;
|
||||
}else{
|
||||
clipFrame.size.height = kGitSplitViewMinWidth * show;
|
||||
}
|
||||
[clipview setFrame:clipFrame];
|
||||
[sp adjustSubviews];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark SplitView Delegates
|
||||
|
||||
#define kGitSplitViewMinWidth 150.0f
|
||||
#define kGitSplitViewMaxWidth 300.0f
|
||||
|
||||
#pragma mark min/max widths while moving the divider
|
||||
|
||||
- (CGFloat)splitView:(NSSplitView *)view constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex
|
||||
|
||||
Reference in New Issue
Block a user