From fb956111f6f38d639ce0a2c8c3137ad44f1b3b56 Mon Sep 17 00:00:00 2001 From: German Laullon Date: Wed, 2 Mar 2011 13:33:07 -0800 Subject: [PATCH 1/3] ToolBar, icons and selector. --- English.lproj/RepositoryWindow.xib | 172 +++++++++++++++++++++++++++-- GitX.xcodeproj/project.pbxproj | 8 ++ PBGitWindowController.h | 1 + PBGitWindowController.m | 4 + list_Template.png | Bin 0 -> 517 bytes sidebar_Template.png | Bin 0 -> 503 bytes 6 files changed, 175 insertions(+), 10 deletions(-) create mode 100644 list_Template.png create mode 100644 sidebar_Template.png diff --git a/English.lproj/RepositoryWindow.xib b/English.lproj/RepositoryWindow.xib index 9b1d7f1..9baf874 100644 --- a/English.lproj/RepositoryWindow.xib +++ b/English.lproj/RepositoryWindow.xib @@ -2,17 +2,17 @@ 1050 - 10F569 - 804 - 1038.29 - 461.00 + 10J567 + 788 + 1038.35 + 462.00 com.apple.InterfaceBuilder.CocoaPlugin - 804 + 788 YES - + YES @@ -58,6 +58,7 @@ 41FA1145-D953-446F-B6DF-0230885AB433 7A8FEE7B-B273-4AF3-8A22-53A9DAF786FA B15C57F2-985F-4446-9A29-34C76DBA9042 + D43D38AE-6110-463C-8514-FC8ACC0F327C FF15EAEC-D5AB-4C6F-9E13-4B62C6692BFC NSToolbarFlexibleSpaceItem NSToolbarSeparatorItem @@ -92,9 +93,10 @@ Clone Repository To - + 268 {{38, 14}, {40, 25}} + YES -2080244224 @@ -137,9 +139,10 @@ Refresh - + 268 {{8, 14}, {32, 25}} + YES -2080244224 @@ -170,6 +173,67 @@ YES 0 + + + D43D38AE-6110-463C-8514-FC8ACC0F327C + + View + View + + + + 268 + {{0, 14}, {94, 25}} + + YES + + 67239424 + 0 + + LucidaGrande + 13 + 16 + + + + YES + + 44 + + NSImage + sidebar_Template + + + YES + 2 + + + 43 + + NSImage + list_Template + + + 1 + YES + 0 + + + 1 + 2 + + + + + + {94, 25} + {94, 25} + YES + YES + 0 + YES + 0 + FF15EAEC-D5AB-4C6F-9E13-4B62C6692BFC @@ -287,11 +351,14 @@ + YES + + @@ -520,6 +587,14 @@ 419 + + + changeLayout: + + + + 423 + @@ -603,6 +678,7 @@ + @@ -719,6 +795,29 @@ Content SplitView + + 422 + + + YES + + + + + + 420 + + + YES + + + + + + 421 + + + @@ -757,6 +856,12 @@ 415.IBPluginDependency 416.IBPluginDependency 417.IBPluginDependency + 420.IBPluginDependency + 420.IBSegmentedControlTracker.RoundRobinState + 420.IBSegmentedControlTracker.WasGrowing + 421.IBPluginDependency + 421.IBSegmentedControlInspectorSelectedSegmentMetadataKey + 422.toolbarItem.selectable 5.IBPluginDependency 5.ImportedFromIB2 @@ -779,7 +884,7 @@ AUM5AAAAAAAAA com.apple.InterfaceBuilder.CocoaPlugin - {{347, 1169}, {616, 0}} + {{207, 573}, {616, 227}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -801,6 +906,12 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin @@ -820,7 +931,7 @@ - 419 + 423 @@ -832,6 +943,13 @@ NSApplication+GitXScripting.h + + NSCell + + IBProjectSource + View/CellTrackingRect.h + + PBGitWindowController NSWindowController @@ -839,6 +957,7 @@ YES YES + changeLayout: cloneTo: openInTerminal: refresh: @@ -854,12 +973,14 @@ id id id + id YES YES + changeLayout: cloneTo: openInTerminal: refresh: @@ -869,6 +990,10 @@ YES + + changeLayout: + id + cloneTo: id @@ -1349,6 +1474,13 @@ QuartzCore.framework/Headers/CIImageProvider.h + + NSObject + + IBFrameworkSource + ScriptingBridge.framework/Headers/SBApplication.h + + NSObject @@ -1456,6 +1588,22 @@ AppKit.framework/Headers/NSResponder.h + + NSSegmentedCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedCell.h + + + + NSSegmentedControl + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedControl.h + + NSSplitView NSView @@ -1587,6 +1735,8 @@ NSMenuCheckmark NSMenuMixedState NSRefreshTemplate + list_Template + sidebar_Template YES @@ -1594,6 +1744,8 @@ {9, 8} {7, 2} {10, 12} + {16, 16} + {16, 16} diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 01e79e9..4ccb7e9 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -60,6 +60,8 @@ 31460CD4124185BA00B90AED /* ReadMe.txt in Resources */ = {isa = PBXBuildFile; fileRef = 31460CAF124185BA00B90AED /* ReadMe.txt */; }; 31460CD5124185BA00B90AED /* Source Code License.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 31460CB0124185BA00B90AED /* Source Code License.rtf */; }; 31460CD6124185BA00B90AED /* TODO in Resources */ = {isa = PBXBuildFile; fileRef = 31460CB1124185BA00B90AED /* TODO */; }; + 316E7202131EE9C600AFBB36 /* list_Template.png in Resources */ = {isa = PBXBuildFile; fileRef = 316E7200131EE9C600AFBB36 /* list_Template.png */; }; + 316E7203131EE9C600AFBB36 /* sidebar_Template.png in Resources */ = {isa = PBXBuildFile; fileRef = 316E7201131EE9C600AFBB36 /* sidebar_Template.png */; }; 31DAA7ED1317737100463846 /* gitx_l_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 31DAA7EC1317737100463846 /* gitx_l_pub.pem */; }; 3BC07F4C0ED5A5C5009A7768 /* HistoryViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */; }; 3BC07F4D0ED5A5C5009A7768 /* CommitViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */; }; @@ -347,6 +349,8 @@ 31460CAF124185BA00B90AED /* ReadMe.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadMe.txt; sourceTree = ""; }; 31460CB0124185BA00B90AED /* Source Code License.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = "Source Code License.rtf"; sourceTree = ""; }; 31460CB1124185BA00B90AED /* TODO */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TODO; sourceTree = ""; }; + 316E7200131EE9C600AFBB36 /* list_Template.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = list_Template.png; sourceTree = ""; }; + 316E7201131EE9C600AFBB36 /* sidebar_Template.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sidebar_Template.png; sourceTree = ""; }; 31DAA7EC1317737100463846 /* gitx_l_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = gitx_l_pub.pem; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* GitX_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitX_Prefix.pch; sourceTree = ""; }; 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = HistoryViewTemplate.png; path = Images/HistoryViewTemplate.png; sourceTree = ""; }; @@ -813,6 +817,8 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + 316E7200131EE9C600AFBB36 /* list_Template.png */, + 316E7201131EE9C600AFBB36 /* sidebar_Template.png */, 21025C1012947AB200D87200 /* sourceListAction.png */, 21025C1112947AB200D87200 /* sourceListActionOver.png */, 02B41A5F123E307F00DFC531 /* PBCommitHookFailedSheet.xib */, @@ -1428,6 +1434,8 @@ 212A49AD12A31350009DAFAD /* ignored_file.png in Resources */, 212A49AF12A3135C009DAFAD /* modified_file.png in Resources */, 31DAA7ED1317737100463846 /* gitx_l_pub.pem in Resources */, + 316E7202131EE9C600AFBB36 /* list_Template.png in Resources */, + 316E7203131EE9C600AFBB36 /* sidebar_Template.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/PBGitWindowController.h b/PBGitWindowController.h index 9b008fc..1cd193c 100644 --- a/PBGitWindowController.h +++ b/PBGitWindowController.h @@ -46,6 +46,7 @@ - (IBAction) openInTerminal:(id)sender; - (IBAction) cloneTo:(id)sender; - (IBAction) refresh:(id)sender; +- (IBAction) changeLayout:(id)sender; - (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode; diff --git a/PBGitWindowController.m b/PBGitWindowController.m index b08dfc2..8a2ce1e 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -215,6 +215,10 @@ [sidebarController setHistorySearch:searchString mode:mode]; } +- (IBAction) changeLayout:(id)sender{ + NSLog(@"selectedSegment=%ld (%d)",[sender selectedSegment],[sender isSelectedForSegment:[sender selectedSegment]]); +} + #pragma mark - diff --git a/list_Template.png b/list_Template.png new file mode 100644 index 0000000000000000000000000000000000000000..690ace16f946248730350862282e94b831f48660 GIT binary patch literal 517 zcmV+g0{Z=lP)KLZ*U+=)p!fv7f#TG` zAxLl%!EgG`&*5<32cu%worY0{L9A7~=}6b}76Isk~1IN~P)K3@?4 z&zpALY4A7Z!>t0&I7qECf*j`WHIYAjW_h^ivJu4lvb8y9VL`DD`rG0ZKvcZ$L@8 zo)6*!Fng}&gE0q~LGCMnsiR8`P)pL0I_sTkS+y)n+TA3GKLZ*U+=)p!fv7f#TG` zAxLl%!EgG`&*5<32cu%worY0{L9A7~=}6b}76Isk~1IN~P)K3@?4 z&zpALY4A7Z!>t0&I7qECf*j`WHIYAjW_h^ivJu4lvb8y9VL`DD`rG0ZKvcZ$L@8 zo)6*!Fng}&gE0q~LGCMnsiR8`P)pL0I_sTkS+y)n+TA3G Date: Wed, 2 Mar 2011 14:40:08 -0800 Subject: [PATCH 2/3] working --- PBGitHistoryController.h | 1 + PBGitHistoryController.m | 1 + PBGitWindowController.h | 4 ++++ PBGitWindowController.m | 28 +++++++++++++++++++++++++--- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index 93bfea0..a456d90 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -57,6 +57,7 @@ } @property (readonly) NSTreeController* treeController; +@property (readonly) PBCollapsibleSplitView *historySplitView; @property (assign) int selectedCommitDetailsIndex; @property (retain) PBGitCommit *webCommit; @property (retain) PBGitTree* gitTree; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index e3be741..bc955cb 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -48,6 +48,7 @@ @synthesize searchController; @synthesize commitList; @synthesize treeController; +@synthesize historySplitView; - (void)awakeFromNib { diff --git a/PBGitWindowController.h b/PBGitWindowController.h index 1cd193c..70b268d 100644 --- a/PBGitWindowController.h +++ b/PBGitWindowController.h @@ -9,6 +9,9 @@ #import #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; diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 8a2ce1e..b2d6b77 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -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 From a60dfa3d99fbb5604afad5a304d8343ff5a937f5 Mon Sep 17 00:00:00 2001 From: German Laullon Date: Wed, 2 Mar 2011 16:12:12 -0800 Subject: [PATCH 3/3] Animation --- PBGitWindowController.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PBGitWindowController.m b/PBGitWindowController.m index b2d6b77..498ddec 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -241,11 +241,11 @@ }else{ clipFrame.size.height = kGitSplitViewMinWidth * show; } - [clipview setFrame:clipFrame]; + + [[clipview animator] setFrame:clipFrame]; [sp adjustSubviews]; } - #pragma mark - #pragma mark SplitView Delegates