Skip to content

Commit

Permalink
reverted kfsplitview to default, didn't realize it was a library by k…
Browse files Browse the repository at this point in the history
…en ferry. also removed divider style customziation from the library and added it into the plugin code
  • Loading branch information
markhuot committed Jul 14, 2011
1 parent 256fa31 commit 15870c3
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
45 changes: 42 additions & 3 deletions src/sidebar/KFSplitView.m
Expand Up @@ -166,14 +166,53 @@ + (void)initialize

- (void)kfSetup
{
// be sure to setup cursors before calling setVertical:
[self kfSetupResizeCursors];

kfCollapsedSubviews = [[NSMutableSet alloc] init];
kfDividerRects = [[NSMutableArray alloc] init];

kfDefaults = [NSUserDefaults standardUserDefaults];
kfNotificationCenter = [NSNotificationCenter defaultCenter];

[self setVertical:[self isVertical]];
[self setDividerStyle:NSSplitViewDividerStyleThin];
}

// Attempts to find cursors to use as kfIsVerticalResizeCursor and kfNotIsVerticalResizeCursor.
// These cursors are eventually released, so make sure each receives a retain message now.
// If no good cursors can be found, an error is printed and the arrow cursor is used.
- (void)kfSetupResizeCursors
{
NSImage *isVerticalImage, *isNotVerticalImage;

if (isVerticalImage = [NSImage imageNamed:@"NSTruthHorizontalResizeCursor"]); // standard Jaguar NSSplitView resize cursor
else if (isVerticalImage = [NSImage imageNamed:@"NSTruthHResizeCursor"]);

if (isVerticalImage)
{
kfIsVerticalResizeCursor = [[NSCursor alloc] initWithImage:isVerticalImage
hotSpot:NSMakePoint(8,8)];
}

if (isNotVerticalImage = [NSImage imageNamed:@"NSTruthVerticalResizeCursor"]); // standard Jaguar NSSplitView resize cursor
else if (isNotVerticalImage = [NSImage imageNamed:@"NSTruthVResizeCursor"]);

if (isNotVerticalImage)
{
kfNotIsVerticalResizeCursor = [[NSCursor alloc] initWithImage:isNotVerticalImage
hotSpot:NSMakePoint(8,8)];
}

if (kfIsVerticalResizeCursor == nil)
{
kfIsVerticalResizeCursor = [[NSCursor arrowCursor] retain];
NSLog(@"Warning - no horizontal resizing cursor located. Please report this as a bug.");
}
if (kfNotIsVerticalResizeCursor == nil)
{
kfNotIsVerticalResizeCursor = [[NSCursor arrowCursor] retain];
NSLog(@"Warning - no vertical resizing cursor located. Please report this as a bug.");
}
}

- (void)awakeFromNib
Expand Down Expand Up @@ -808,11 +847,11 @@ - (void)setVertical:(BOOL)flag
kfIsVertical = flag;
if (kfIsVertical)
{
kfCurrentResizeCursor = [NSCursor resizeLeftRightCursor];
kfCurrentResizeCursor = kfIsVerticalResizeCursor;
}
else
{
kfCurrentResizeCursor = [NSCursor resizeLeftRightCursor];
kfCurrentResizeCursor = kfNotIsVerticalResizeCursor;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/sidebar/SideBarSwitching.mm
Expand Up @@ -44,6 +44,7 @@ - (void)SideBarSwitching_windowDidLoad
[splitView setVertical:YES];
[splitView setDelegate:self];
[splitView setSideBarOnRight:[SideBarSwitching sidebarOnRight]];
[splitView setDividerStyle:NSSplitViewDividerStyleThin];

if(not [SideBarSwitching sidebarOnRight])
[splitView addSubview:drawerView];
Expand Down

0 comments on commit 15870c3

Please sign in to comment.