Skip to content

Commit c36726b

Browse files
committed
Update the GUI to be more iApp like
- In PBGitSidebarView.xib - change indentation to 12 - change font size to 11 - disable the editable behavior - disable autoresizing - disable user resizing (column should resize with view) - remove the window - remove the shared user defaults controller (not being used) - add a project item with the project's name - a "Stage" item to go to what has been called the commit view - new icons for branches, remote branches and tags (created by Nathan Kinsinger) - remove the old tiff icons, PBSourceViewRemote.h/m and PBSourceViewAction.h/m from the xcode project - uses system icon for folder - uses Network icon for remotes - capitalize group names - rename the Custom group to Other (you can't really customize items in the traditional sense) - create a class for each item type that takes care of it's image (instead of trying to guess the image from it or it's parent's name) - remove the branch menu toolbar item from the history view, it's redundant now
1 parent 4ea0435 commit c36726b

33 files changed

+1257
-524
lines changed

GitX.xcodeproj/project.pbxproj

+71-30
Large diffs are not rendered by default.

Images/Branch.acorn

1.81 KB
Binary file not shown.

Images/Branch.png

546 Bytes
Loading

Images/RemoteBranch.acorn

1.77 KB
Binary file not shown.

Images/RemoteBranch.png

513 Bytes
Loading

Images/StageView.png

271 Bytes
Loading

Images/Tag.acorn

1.75 KB
Binary file not shown.

Images/Tag.png

527 Bytes
Loading

PBGitHistoryView.xib

+92-212
Large diffs are not rendered by default.

PBGitRevSpecifier.h

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- (PBGitRef *) ref;
2424
- (BOOL) hasPathLimiter;
2525
- (BOOL) hasLeftRight;
26+
- (NSString *) title;
2627

2728
- (BOOL) isEqualTo: (PBGitRevSpecifier*) other;
2829
- (BOOL) isAllBranchesRev;

PBGitRevSpecifier.m

+22
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,28 @@ - (NSString*) description
8585
return [parameters componentsJoinedByString:@" "];
8686
}
8787

88+
- (NSString *) title
89+
{
90+
NSString *title = nil;
91+
92+
if ([self.description isEqualToString:@"HEAD"])
93+
title = @"detached HEAD";
94+
else if ([self isSimpleRef])
95+
title = [[self ref] shortName];
96+
else if ([self.description hasPrefix:@"-S"])
97+
title = [self.description substringFromIndex:[@"-S" length]];
98+
else if ([self.description hasPrefix:@"HEAD -- "])
99+
title = [self.description substringFromIndex:[@"HEAD -- " length]];
100+
else if ([self.description hasPrefix:@"-- "])
101+
title = [self.description substringFromIndex:[@"-- " length]];
102+
else if ([self.description hasPrefix:@"--left-right "])
103+
title = [self.description substringFromIndex:[@"--left-right " length]];
104+
else
105+
title = self.description;
106+
107+
return [NSString stringWithFormat:@"\"%@\"", title];
108+
}
109+
88110
- (BOOL) hasPathLimiter;
89111
{
90112
for (NSString* param in parameters)

PBGitSVBranchItem.h

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// PBGitSVBranchItem.h
3+
// GitX
4+
//
5+
// Created by Nathan Kinsinger on 3/2/10.
6+
// Copyright 2010 Nathan Kinsinger. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
#import "PBSourceViewItem.h"
11+
12+
13+
@interface PBGitSVBranchItem : PBSourceViewItem {
14+
15+
}
16+
17+
+ (id)branchItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier;
18+
19+
@end

PBGitSVBranchItem.m

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// PBGitSVBranchItem.m
3+
// GitX
4+
//
5+
// Created by Nathan Kinsinger on 3/2/10.
6+
// Copyright 2010 Nathan Kinsinger. All rights reserved.
7+
//
8+
9+
#import "PBGitSVBranchItem.h"
10+
11+
12+
@implementation PBGitSVBranchItem
13+
14+
15+
+ (id)branchItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier
16+
{
17+
PBGitSVBranchItem *item = [self itemWithTitle:[[revSpecifier description] lastPathComponent]];
18+
item.revSpecifier = revSpecifier;
19+
20+
return item;
21+
}
22+
23+
24+
- (NSImage *) icon
25+
{
26+
static NSImage *branchImage = nil;
27+
if (!branchImage)
28+
branchImage = [NSImage imageNamed:@"Branch.png"];
29+
30+
return branchImage;
31+
}
32+
33+
@end

PBGitSVFolderItem.h

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// PBGitSVFolderItem.h
3+
// GitX
4+
//
5+
// Created by Nathan Kinsinger on 3/2/10.
6+
// Copyright 2010 Nathan Kinsinger. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
#import "PBSourceViewItem.h"
11+
12+
13+
@interface PBGitSVFolderItem : PBSourceViewItem {
14+
15+
}
16+
17+
+ (id)folderItemWithTitle:(NSString *)title;
18+
19+
@end

PBGitSVFolderItem.m

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//
2+
// PBGitSVFolderItem.m
3+
// GitX
4+
//
5+
// Created by Nathan Kinsinger on 3/2/10.
6+
// Copyright 2010 Nathan Kinsinger. All rights reserved.
7+
//
8+
9+
#import "PBGitSVFolderItem.h"
10+
11+
12+
@implementation PBGitSVFolderItem
13+
14+
15+
+ (id)folderItemWithTitle:(NSString *)title
16+
{
17+
PBGitSVFolderItem *item = [self itemWithTitle:title];
18+
19+
return item;
20+
}
21+
22+
23+
- (NSImage *) icon
24+
{
25+
static NSImage *folderImage = nil;
26+
if (!folderImage) {
27+
folderImage = [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kGenericFolderIcon)];
28+
[folderImage setSize:NSMakeSize(16,16)];
29+
}
30+
31+
return folderImage;
32+
}
33+
34+
@end

PBGitSVOtherRevItem.h

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// PBGitSVOtherRevItem.h
3+
// GitX
4+
//
5+
// Created by Nathan Kinsinger on 3/2/10.
6+
// Copyright 2010 Nathan Kinsinger. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
#import "PBSourceViewItem.h"
11+
12+
13+
@interface PBGitSVOtherRevItem : PBSourceViewItem {
14+
15+
}
16+
17+
+ (id)otherItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier;
18+
19+
@end

PBGitSVOtherRevItem.m

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//
2+
// PBGitSVOtherRevItem.m
3+
// GitX
4+
//
5+
// Created by Nathan Kinsinger on 3/2/10.
6+
// Copyright 2010 Nathan Kinsinger. All rights reserved.
7+
//
8+
9+
#import "PBGitSVOtherRevItem.h"
10+
#import "PBGitRevSpecifier.h"
11+
12+
13+
@implementation PBGitSVOtherRevItem
14+
15+
16+
+ (id)otherItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier
17+
{
18+
PBGitSVOtherRevItem *item = [self itemWithTitle:[revSpecifier title]];
19+
item.revSpecifier = revSpecifier;
20+
21+
return item;
22+
}
23+
24+
25+
- (NSImage *) icon
26+
{
27+
static NSImage *otherRevImage = nil;
28+
if (!otherRevImage)
29+
otherRevImage = [NSImage imageNamed:@"Branch.png"];
30+
31+
return otherRevImage;
32+
}
33+
34+
@end

PBGitSVRemoteBranchItem.h

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// PBGitSVRemoteBranchItem.h
3+
// GitX
4+
//
5+
// Created by Nathan Kinsinger on 3/2/10.
6+
// Copyright 2010 Nathan Kinsinger. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
#import "PBSourceViewItem.h"
11+
12+
13+
@interface PBGitSVRemoteBranchItem : PBSourceViewItem {
14+
15+
}
16+
17+
+ (id)remoteBranchItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier;
18+
19+
@end

PBGitSVRemoteBranchItem.m

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// PBGitSVRemoteBranchItem.m
3+
// GitX
4+
//
5+
// Created by Nathan Kinsinger on 3/2/10.
6+
// Copyright 2010 Nathan Kinsinger. All rights reserved.
7+
//
8+
9+
#import "PBGitSVRemoteBranchItem.h"
10+
11+
12+
@implementation PBGitSVRemoteBranchItem
13+
14+
15+
+ (id)remoteBranchItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier
16+
{
17+
PBGitSVRemoteBranchItem *item = [self itemWithTitle:[[revSpecifier description] lastPathComponent]];
18+
item.revSpecifier = revSpecifier;
19+
20+
return item;
21+
}
22+
23+
24+
- (NSImage *) icon
25+
{
26+
static NSImage *remoteBranchImage = nil;
27+
if (!remoteBranchImage)
28+
remoteBranchImage = [NSImage imageNamed:@"RemoteBranch.png"];
29+
30+
return remoteBranchImage;
31+
}
32+
33+
@end

PBGitSVRemoteItem.h

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// PBGitSVRemoteItem.h
3+
// GitX
4+
//
5+
// Created by Nathan Kinsinger on 3/2/10.
6+
// Copyright 2010 Nathan Kinsinger. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
#import "PBSourceViewItem.h"
11+
12+
13+
@interface PBGitSVRemoteItem : PBSourceViewItem {
14+
15+
}
16+
17+
+ (id)remoteItemWithTitle:(NSString *)title;
18+
19+
@end

PBGitSVRemoteItem.m

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//
2+
// PBGitSVRemoteItem.m
3+
// GitX
4+
//
5+
// Created by Nathan Kinsinger on 3/2/10.
6+
// Copyright 2010 Nathan Kinsinger. All rights reserved.
7+
//
8+
9+
#import "PBGitSVRemoteItem.h"
10+
#import "PBGitRef.h"
11+
12+
13+
@implementation PBGitSVRemoteItem
14+
15+
16+
+ (id)remoteItemWithTitle:(NSString *)title
17+
{
18+
PBGitSVRemoteItem *item = [self itemWithTitle:title];
19+
20+
return item;
21+
}
22+
23+
24+
- (NSImage *) icon
25+
{
26+
static NSImage *networkImage = nil;
27+
if (!networkImage) {
28+
networkImage = [NSImage imageNamed:NSImageNameNetwork];
29+
[networkImage setSize:NSMakeSize(16,16)];
30+
}
31+
32+
return networkImage;
33+
}
34+
35+
36+
- (PBGitRef *) ref
37+
{
38+
return [PBGitRef refFromString:[kGitXRemoteRefPrefix stringByAppendingString:self.title]];
39+
}
40+
41+
@end

PBGitSVStageItem.h

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// PBGitSVStageItem.h
3+
// GitX
4+
//
5+
// Created by Nathan Kinsinger on 3/2/10.
6+
// Copyright 2010 Nathan Kinsinger. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
#import "PBSourceViewItem.h"
11+
12+
13+
@interface PBGitSVStageItem : PBSourceViewItem {
14+
15+
}
16+
17+
+ (id) stageItem;
18+
19+
@end

PBGitSVStageItem.m

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
//
2+
// PBGitSVStageItem.m
3+
// GitX
4+
//
5+
// Created by Nathan Kinsinger on 3/2/10.
6+
// Copyright 2010 Nathan Kinsinger. All rights reserved.
7+
//
8+
9+
#import "PBGitSVStageItem.h"
10+
11+
12+
@implementation PBGitSVStageItem
13+
14+
15+
+ (id) stageItem
16+
{
17+
PBGitSVStageItem *item = [self itemWithTitle:@"Stage"];
18+
19+
return item;
20+
}
21+
22+
23+
- (NSImage *) icon
24+
{
25+
static NSImage *stageImage = nil;
26+
if (!stageImage)
27+
stageImage = [NSImage imageNamed:@"StageView"];
28+
29+
return stageImage;
30+
}
31+
32+
@end

PBGitSVTagItem.h

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// PBGitSVTagItem.h
3+
// GitX
4+
//
5+
// Created by Nathan Kinsinger on 3/2/10.
6+
// Copyright 2010 Nathan Kinsinger. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
#import "PBSourceViewItem.h"
11+
12+
13+
@interface PBGitSVTagItem : PBSourceViewItem {
14+
15+
}
16+
17+
+ (id)tagItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier;
18+
19+
@end

0 commit comments

Comments
 (0)