Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding preference for tabs vs. workspace, thanks @synewaves

  • Loading branch information...
commit 3e0989bf2355794d7b555d3c037d5e5b29c7c6e4 1 parent 4bf96af
@markhuot authored
View
176 resources/Preferences.xib
@@ -62,7 +62,7 @@
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSCustomView" id="1005">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">286</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -71,6 +71,7 @@
<int key="NSvFlags">30</int>
<string key="NSFrame">{{13, 10}, {422, 256}}</string>
<reference key="NSSuperview" ref="1005"/>
+ <reference key="NSWindow"/>
<object class="NSMutableArray" key="NSTabViewItems">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSTabViewItem" id="865866011">
@@ -83,8 +84,9 @@
<object class="NSButton" id="1039400470">
<reference key="NSNextResponder" ref="451116678"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{39, 173}, {212, 18}}</string>
+ <string key="NSFrame">{{39, 177}, {212, 18}}</string>
<reference key="NSSuperview" ref="451116678"/>
+ <reference key="NSNextKeyView" ref="812202712"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="300540491">
<int key="NSCellFlags">-2080244224</int>
@@ -114,13 +116,14 @@
<object class="NSTextField" id="812202712">
<reference key="NSNextResponder" ref="451116678"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{57.5, 139}, {295, 28}}</string>
+ <string key="NSFrame">{{57.5, 145}, {295, 28}}</string>
<reference key="NSSuperview" ref="451116678"/>
+ <reference key="NSNextKeyView" ref="92485206"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="358193794">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">272629760</int>
- <string key="NSContents">This will replace the standard project drawer with a panel embedded into the window (as with Tiger’s Mail.app).</string>
+ <string key="NSContents">This will replace the standard project drawer with a panel embedded into the window.</string>
<object class="NSFont" key="NSSupport" id="530061995">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">11</double>
@@ -150,8 +153,9 @@
<object class="NSTextField" id="328226311">
<reference key="NSNextResponder" ref="451116678"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{57.5, 56}, {295, 28}}</string>
+ <string key="NSFrame">{{57.5, 75}, {295, 28}}</string>
<reference key="NSSuperview" ref="451116678"/>
+ <reference key="NSNextKeyView" ref="879038412"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="686137254">
<int key="NSCellFlags">67239424</int>
@@ -166,8 +170,9 @@
<object class="NSButton" id="92485206">
<reference key="NSNextResponder" ref="451116678"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{39, 90}, {308, 18}}</string>
+ <string key="NSFrame">{{39, 105}, {308, 18}}</string>
<reference key="NSSuperview" ref="451116678"/>
+ <reference key="NSNextKeyView" ref="328226311"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="763898095">
<int key="NSCellFlags">-2080244224</int>
@@ -188,16 +193,16 @@
<object class="NSTextField" id="879038412">
<reference key="NSNextResponder" ref="451116678"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{35, 17}, {324, 17}}</string>
+ <string key="NSFrame">{{59, -12}, {287.5, 26}}</string>
<reference key="NSSuperview" ref="451116678"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="309721039">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">272629760</int>
- <string key="NSContents">These settings will take effect for new project windows</string>
- <object class="NSFont" key="NSSupport" id="282865970">
+ <string key="NSContents">(These settings will take effect for new project windows)</string>
+ <object class="NSFont" key="NSSupport" id="24">
<string key="NSName">LucidaGrande</string>
- <double key="NSSize">12</double>
+ <double key="NSSize">10</double>
<int key="NSfFlags">16</int>
</object>
<reference key="NSControlView" ref="879038412"/>
@@ -207,6 +212,7 @@
</object>
</object>
<string key="NSFrame">{{10, 33}, {402, 210}}</string>
+ <reference key="NSNextKeyView" ref="1039400470"/>
</object>
<string key="NSLabel">Sidebar</string>
<reference key="NSColor" ref="646245018"/>
@@ -262,7 +268,11 @@
<int key="NSCellFlags">67239488</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">Deleted Items</string>
- <reference key="NSSupport" ref="282865970"/>
+ <object class="NSFont" key="NSSupport" id="282865970">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">12</double>
+ <int key="NSfFlags">16</int>
+ </object>
<reference key="NSControlView" ref="20890325"/>
<reference key="NSBackgroundColor" ref="646245018"/>
<reference key="NSTextColor" ref="635366707"/>
@@ -806,11 +816,7 @@
<int key="NSCellFlags">67239488</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">Label Opacity:</string>
- <object class="NSFont" key="NSSupport">
- <string key="NSName">LucidaGrande</string>
- <double key="NSSize">10</double>
- <int key="NSfFlags">16</int>
- </object>
+ <reference key="NSSupport" ref="24"/>
<reference key="NSControlView" ref="133071125"/>
<reference key="NSBackgroundColor" ref="646245018"/>
<reference key="NSTextColor" ref="635366707"/>
@@ -913,8 +919,10 @@
<object class="NSButton" id="67004955">
<reference key="NSNextResponder" ref="382547034"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{39, 173}, {187, 18}}</string>
+ <string key="NSFrame">{{39, 185}, {187, 18}}</string>
<reference key="NSSuperview" ref="382547034"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="627620658"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="300042012">
<int key="NSCellFlags">-2080244224</int>
@@ -935,13 +943,15 @@
<object class="NSTextField" id="96621171">
<reference key="NSNextResponder" ref="382547034"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{57, 56}, {289, 28}}</string>
+ <string key="NSFrame">{{57, 93}, {289, 28}}</string>
<reference key="NSSuperview" ref="382547034"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="399716151"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="1026543272">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">272629760</int>
- <string key="NSContents">This will add a context menu option with options for configuring the sort criteria used for the file list</string>
+ <string key="NSContents">This will add a context menu option with options for configuring the sort criteria used for the file list.</string>
<reference key="NSSupport" ref="530061995"/>
<reference key="NSControlView" ref="96621171"/>
<reference key="NSBackgroundColor" ref="646245018"/>
@@ -951,8 +961,10 @@
<object class="NSButton" id="444632897">
<reference key="NSNextResponder" ref="382547034"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{39, 90}, {148, 18}}</string>
+ <string key="NSFrame">{{39, 122}, {148, 18}}</string>
<reference key="NSSuperview" ref="382547034"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="96621171"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="635682693">
<int key="NSCellFlags">-2080244224</int>
@@ -973,13 +985,15 @@
<object class="NSTextField" id="627620658">
<reference key="NSNextResponder" ref="382547034"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{57, 139}, {295, 28}}</string>
+ <string key="NSFrame">{{57, 141}, {309, 42}}</string>
<reference key="NSSuperview" ref="382547034"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="444632897"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="436839442">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">272629760</int>
- <string key="NSContents">When this is checked the project tree will remember which items were expanded when you reload a project</string>
+ <string key="NSContents">When this is checked the project tree will remember which items were expanded when you reload a project.</string>
<reference key="NSSupport" ref="530061995"/>
<reference key="NSControlView" ref="627620658"/>
<reference key="NSBackgroundColor" ref="646245018"/>
@@ -989,14 +1003,16 @@
<object class="NSButton" id="399716151">
<reference key="NSNextResponder" ref="382547034"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{51, 22}, {106, 32}}</string>
+ <string key="NSFrame">{{51, 57}, {106, 32}}</string>
<reference key="NSSuperview" ref="382547034"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="330521489"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="543457298">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Defaults…</string>
- <reference key="NSSupport" ref="62353035"/>
+ <reference key="NSSupport" ref="282865970"/>
<reference key="NSControlView" ref="399716151"/>
<int key="NSButtonFlags">-2038284033</int>
<int key="NSButtonFlags2">129</int>
@@ -1006,9 +1022,52 @@
<int key="NSPeriodicInterval">25</int>
</object>
</object>
+ <object class="NSButton" id="330521489">
+ <reference key="NSNextResponder" ref="382547034"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{39, 36}, {214, 18}}</string>
+ <reference key="NSSuperview" ref="382547034"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="524294248"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="278547065">
+ <int key="NSCellFlags">-2080244224</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Use workspace instead of tabs</string>
+ <reference key="NSSupport" ref="62353035"/>
+ <reference key="NSControlView" ref="330521489"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSNormalImage" ref="763398945"/>
+ <reference key="NSAlternateImage" ref="448203206"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="524294248">
+ <reference key="NSNextResponder" ref="382547034"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{56, -8}, {310, 42}}</string>
+ <reference key="NSSuperview" ref="382547034"/>
+ <reference key="NSWindow"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="854313440">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">272629760</int>
+ <string key="NSContents">Use workspace in sidebar instead of standard tab view. (This setting will take affect after restarting TextMate)</string>
+ <reference key="NSSupport" ref="530061995"/>
+ <reference key="NSControlView" ref="524294248"/>
+ <reference key="NSBackgroundColor" ref="646245018"/>
+ <reference key="NSTextColor" ref="635366707"/>
+ </object>
+ </object>
</object>
<string key="NSFrame">{{10, 33}, {402, 210}}</string>
<reference key="NSSuperview" ref="520768783"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="67004955"/>
</object>
<string key="NSLabel">Tree</string>
<reference key="NSColor" ref="646245018"/>
@@ -1027,6 +1086,9 @@
</object>
</object>
<string key="NSFrameSize">{448, 272}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="520768783"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSUserDefaultsController" id="259204075">
@@ -1087,7 +1149,7 @@
<nil key="NSViewClass"/>
<nil key="NSUserInterfaceItemIdentifier"/>
<object class="NSView" key="NSWindowView" id="943278790">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -1096,8 +1158,6 @@
<int key="NSvFlags">289</int>
<string key="NSFrame">{{211, 12}, {96, 32}}</string>
<reference key="NSSuperview" ref="943278790"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="564481282">
<int key="NSCellFlags">67239424</int>
@@ -1118,7 +1178,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{17, 113}, {290, 17}}</string>
<reference key="NSSuperview" ref="943278790"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="796136889"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="562335469">
@@ -1140,7 +1199,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{18, 63}, {102, 18}}</string>
<reference key="NSSuperview" ref="943278790"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="566139477"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="423316580">
@@ -1164,7 +1222,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{18, 83}, {96, 18}}</string>
<reference key="NSSuperview" ref="943278790"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="239897329"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="290260247">
@@ -1188,7 +1245,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{18, 44}, {119, 18}}</string>
<reference key="NSSuperview" ref="943278790"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="269049186"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="1050170523">
@@ -1209,8 +1265,6 @@
</object>
</object>
<string key="NSFrame">{{7, 11}, {324, 150}}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="997719337"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
@@ -1646,6 +1700,22 @@
</object>
<int key="connectionID">216</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: values.ProjectPlus Workspace</string>
+ <reference key="source" ref="330521489"/>
+ <reference key="destination" ref="259204075"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="330521489"/>
+ <reference key="NSDestination" ref="259204075"/>
+ <string key="NSLabel">value: values.ProjectPlus Workspace</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">values.ProjectPlus Workspace</string>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">232</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -2136,6 +2206,8 @@
<reference ref="444632897"/>
<reference ref="96621171"/>
<reference ref="67004955"/>
+ <reference ref="524294248"/>
+ <reference ref="330521489"/>
<reference ref="399716151"/>
</object>
<reference key="parent" ref="563731609"/>
@@ -2430,6 +2502,34 @@
<reference key="object" ref="564481282"/>
<reference key="parent" ref="269049186"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">219</int>
+ <reference key="object" ref="330521489"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="278547065"/>
+ </object>
+ <reference key="parent" ref="382547034"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">220</int>
+ <reference key="object" ref="278547065"/>
+ <reference key="parent" ref="330521489"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">217</int>
+ <reference key="object" ref="524294248"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="854313440"/>
+ </object>
+ <reference key="parent" ref="382547034"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">218</int>
+ <reference key="object" ref="854313440"/>
+ <reference key="parent" ref="524294248"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -2495,7 +2595,11 @@
<string>207.IBPluginDependency</string>
<string>208.IBPluginDependency</string>
<string>21.IBPluginDependency</string>
+ <string>217.IBPluginDependency</string>
+ <string>218.IBPluginDependency</string>
+ <string>219.IBPluginDependency</string>
<string>22.IBPluginDependency</string>
+ <string>220.IBPluginDependency</string>
<string>25.IBPluginDependency</string>
<string>26.IBPluginDependency</string>
<string>40.IBPluginDependency</string>
@@ -2627,6 +2731,10 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
@@ -2706,7 +2814,7 @@
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
- <int key="maxID">216</int>
+ <int key="maxID">232</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
View
150 src/ProjectTree.mm
@@ -6,6 +6,7 @@
@interface ProjectTree : NSObject
+ (BOOL)preserveTreeState;
++ (BOOL)useWorkspace;
@end
@implementation NSWindowController (OakProjectController)
@@ -31,6 +32,11 @@ - (void)expandItems:(NSArray*)items inOutlineView:(NSOutlineView*)outlineView to
}
}
+/*
+ add full screen btn
+ http://git.chromium.org/gitweb/?p=chromium.git;a=commitdiff;h=a9a0528306a7a1e43bea6534792d9d7ee7ee9981
+*/
+
- (void)ProjectTree_windowDidLoad
{
[self ProjectTree_windowDidLoad];
@@ -38,10 +44,14 @@ - (void)ProjectTree_windowDidLoad
if(not [ProjectTree preserveTreeState])
return;
- NSArray *rootItems = [self valueForKey:@"rootItems"];
+ [[NSApplication sharedApplication] setPresentationOptions:NSApplicationPresentationFullScreen];
- [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"OakProjectWindowShowTabBarEnabled"];
- [[NSUserDefaults standardUserDefaults] synchronize];
+ NSWindow *window = [self window];
+ NSButton* fullscreenButton = [window standardWindowButton:NSWindowFullScreenButton];
+ //[fullscreenButton setAction:@selector(enterFullscreen:)];
+ //[fullscreenButton setTarget:self];
+
+ NSArray *rootItems = [self valueForKey:@"rootItems"];
/*NSDictionary *newRoot = [NSDictionary dictionaryWithObjectsAndKeys:
@"Files", @"displayName",
@@ -94,57 +104,60 @@ - (void)ProjectTree_windowDidLoad
// height at all.
[fileBrowserScrollView setFrame:NSMakeRect(0, 0, [drawer frame].size.width, [drawer frame].size.height)];
- // Create the Open Files View
- //
- // No IB for plugins so a lot of code here to programatically create a scroll view to
- // contain the open files view
- NSRect scrollFrame = NSMakeRect(0.0, [drawer frame].size.height, [drawer frame].size.width, 0.0);
- NSScrollView* newScrollView = [[[NSScrollView alloc] initWithFrame:scrollFrame] autorelease];
- [newScrollView setVerticalScroller:NO];
- [newScrollView setHorizontalScroller:NO];
- [newScrollView setBorderType:NSNoBorder];
- [newScrollView setAutohidesScrollers:YES];
- [newScrollView setAutoresizingMask:NSViewWidthSizable|NSViewMinYMargin];
-
- NSRect clipViewBounds = [[newScrollView contentView] bounds];
- MHOutlineView *openFiles = [[[MHOutlineView alloc] initWithFrame:clipViewBounds] autorelease];
- [openFiles setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleSourceList];
- [openFiles setRowHeight:14];
- [openFiles setIntercellSpacing:NSMakeSize(3.0, 6.0)];
- [openFiles setHeaderView:nil];
- [openFiles setFocusRingType:NSFocusRingTypeNone];
- [openFiles setAutoresizingMask:NSViewWidthSizable];
-
- id cell = [[OakImageAndTextCell alloc] init];
- [cell setFont:[NSFont fontWithName:@"Lucida Grande" size:11.0]];
-
- NSTableColumn* firstColumn = [[[NSTableColumn alloc] initWithIdentifier:@"firstColumn"] autorelease];
- [[firstColumn headerCell] setStringValue:@"First Column"];
- [firstColumn setResizingMask:NSTableColumnAutoresizingMask];
- [firstColumn setWidth:[drawer frame].size.width];
- [firstColumn setDataCell:cell];
- [openFiles addTableColumn:firstColumn];
- [openFiles setOutlineTableColumn:firstColumn];
-
- MHOpenFiles *openFilesClass = [MHOpenFiles objectForTabs:[self valueForKey:@"tabBarView"]];
- [openFiles setDataSource:openFilesClass];
- [openFiles setDelegate:openFilesClass];
- [openFilesClass setOutlineView:openFiles];
- [openFilesClass setFileBrowserView:[self valueForKey:@"outlineView"]];
-
- [newScrollView setDocumentView:openFiles];
- [drawer addSubview:newScrollView];
-
- // Add the divider
- //
- //
- NSView *dividerView = [[MHDividerView alloc] initWithFrame:NSMakeRect(0, [drawer frame].size.height+2, [drawer frame].size.width, 2.0)];
- [dividerView setAutoresizingMask:NSViewWidthSizable|NSViewMinYMargin];
- [drawer addSubview:dividerView];
+ if ([ProjectTree useWorkspace])
+ {
+ // Create the Open Files View
+ //
+ // No IB for plugins so a lot of code here to programatically create a scroll view to
+ // contain the open files view
+ NSRect scrollFrame = NSMakeRect(0.0, [drawer frame].size.height, [drawer frame].size.width, 0.0);
+ NSScrollView* newScrollView = [[[NSScrollView alloc] initWithFrame:scrollFrame] autorelease];
+ [newScrollView setVerticalScroller:NO];
+ [newScrollView setHorizontalScroller:NO];
+ [newScrollView setBorderType:NSNoBorder];
+ [newScrollView setAutohidesScrollers:YES];
+ [newScrollView setAutoresizingMask:NSViewWidthSizable|NSViewMinYMargin];
+
+ NSRect clipViewBounds = [[newScrollView contentView] bounds];
+ MHOutlineView *openFiles = [[[MHOutlineView alloc] initWithFrame:clipViewBounds] autorelease];
+ [openFiles setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleSourceList];
+ [openFiles setRowHeight:14];
+ [openFiles setIntercellSpacing:NSMakeSize(3.0, 6.0)];
+ [openFiles setHeaderView:nil];
+ [openFiles setFocusRingType:NSFocusRingTypeNone];
+ [openFiles setAutoresizingMask:NSViewWidthSizable];
+
+ id cell = [[OakImageAndTextCell alloc] init];
+ [cell setFont:[NSFont fontWithName:@"Lucida Grande" size:11.0]];
+
+ NSTableColumn* firstColumn = [[[NSTableColumn alloc] initWithIdentifier:@"firstColumn"] autorelease];
+ [[firstColumn headerCell] setStringValue:@"First Column"];
+ [firstColumn setResizingMask:NSTableColumnAutoresizingMask];
+ [firstColumn setWidth:[drawer frame].size.width];
+ [firstColumn setDataCell:cell];
+ [openFiles addTableColumn:firstColumn];
+ [openFiles setOutlineTableColumn:firstColumn];
+
+ MHOpenFiles *openFilesClass = [MHOpenFiles objectForTabs:[self valueForKey:@"tabBarView"]];
+ [openFiles setDataSource:openFilesClass];
+ [openFiles setDelegate:openFilesClass];
+ [openFilesClass setOutlineView:openFiles];
+ [openFilesClass setFileBrowserView:[self valueForKey:@"outlineView"]];
+
+ [newScrollView setDocumentView:openFiles];
+ [drawer addSubview:newScrollView];
+
+ // Add the divider
+ //
+ //
+ NSView *dividerView = [[MHDividerView alloc] initWithFrame:NSMakeRect(0, [drawer frame].size.height+2, [drawer frame].size.width, 2.0)];
+ [dividerView setAutoresizingMask:NSViewWidthSizable|NSViewMinYMargin];
+ [drawer addSubview:dividerView];
- // Let our class know where the divider is so it can be moved around as the
- // open file list changes
- [openFilesClass setDividerView:dividerView];
+ // Let our class know where the divider is so it can be moved around as the
+ // open file list changes
+ [openFilesClass setDividerView:dividerView];
+ }
// eventually remove the ugly buttons, for now they just get covered by the scroll view though
// NSArray *subviews = [[scrollView superview] subviews];
@@ -230,18 +243,41 @@ - (void)ProjectTree_tabBarView:(id)arg1 didSelectTab:(id)arg2
@implementation ProjectTree
+ (void)load
{
- [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], @"ProjectPlus Preserve Tree", nil]];
+ [[NSUserDefaults standardUserDefaults]
+ registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithBool:YES], @"ProjectPlus Preserve Tree",
+ [NSNumber numberWithBool:YES], @"ProjectPlus Workspace",
+ nil]];
[NSClassFromString(@"OakProjectController") jr_swizzleMethod:@selector(windowDidLoad) withMethod:@selector(ProjectTree_windowDidLoad) error:NULL];
[NSClassFromString(@"OakProjectController") jr_swizzleMethod:@selector(writeToFile:) withMethod:@selector(ProjectTree_writeToFile:) error:NULL];
[NSClassFromString(@"OakProjectController") jr_swizzleMethod:@selector(outlineView:willDisplayCell:forTableColumn:item:) withMethod:@selector(ProjectTree_outlineView:willDisplayCell:forTableColumn:item:) error:NULL];
- [NSClassFromString(@"OakProjectController") jr_swizzleMethod:@selector(tabBarView:didOpenTab:) withMethod:@selector(ProjectTree_tabBarView:didOpenTab:) error:NULL];
- [NSClassFromString(@"OakProjectController") jr_swizzleMethod:@selector(tabBarView:didCloseTab:) withMethod:@selector(ProjectTree_tabBarView:didCloseTab:) error:NULL];
- [NSClassFromString(@"OakProjectController") jr_swizzleMethod:@selector(tabBarView:didSelectTab:) withMethod:@selector(ProjectTree_tabBarView:didSelectTab:) error:NULL];
+
+ // toggle workspace vs. tabs
+ if ([ProjectTree useWorkspace])
+ {
+ [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"OakProjectWindowShowTabBarEnabled"];
+ [[NSUserDefaults standardUserDefaults] synchronize];
+
+ [NSClassFromString(@"OakProjectController") jr_swizzleMethod:@selector(tabBarView:didOpenTab:) withMethod:@selector(ProjectTree_tabBarView:didOpenTab:) error:NULL];
+ [NSClassFromString(@"OakProjectController") jr_swizzleMethod:@selector(tabBarView:didCloseTab:) withMethod:@selector(ProjectTree_tabBarView:didCloseTab:) error:NULL];
+ [NSClassFromString(@"OakProjectController") jr_swizzleMethod:@selector(tabBarView:didSelectTab:) withMethod:@selector(ProjectTree_tabBarView:didSelectTab:) error:NULL];
+ }
+
+ else
+ {
+ [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"OakProjectWindowShowTabBarEnabled"];
+ [[NSUserDefaults standardUserDefaults] synchronize];
+ }
}
+ (BOOL)preserveTreeState;
{
return [[NSUserDefaults standardUserDefaults] boolForKey:@"ProjectPlus Preserve Tree"];
}
+
++ (BOOL)useWorkspace;
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"ProjectPlus Workspace"];
+}
@end
View
1  src/sidebar/SideBarSwitching.mm
@@ -173,6 +173,7 @@ + (void)load
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES],@"ProjectPlus Sidebar Enabled",
[NSNumber numberWithBool:NO], @"ProjectPlus Sidebar on Right",
+ [NSNumber numberWithBool:YES], @"ProjectPlus Workspace",
nil]];
[OakProjectController jr_swizzleMethod:@selector(windowDidLoad) withMethod:@selector(SideBarSwitching_windowDidLoad) error:NULL];
Please sign in to comment.
Something went wrong with that request. Please try again.