5 // Created by Pieter de Bie on 31-10-08.
6 // Copyright 2008 Pieter de Bie. All rights reserved.
9 #import "PBNiceSplitView.h"
14 @implementation PBNiceSplitView
18 NSString *barPath = [[NSBundle mainBundle] pathForResource:@"mainSplitterBar" ofType:@"tiff"];
19 bar = [[NSImage alloc] initWithContentsOfFile: barPath];
20 [bar setFlipped: YES];
22 NSString *gripPath = [[NSBundle mainBundle] pathForResource:@"mainSplitterDimple" ofType:@"tiff"];
23 grip = [[NSImage alloc] initWithContentsOfFile: gripPath];
24 [grip setFlipped: YES];
27 - (void)drawDividerInRect:(NSRect)aRect
29 // Draw bar and grip onto the canvas
30 NSRect gripRect = aRect;
31 gripRect.origin.x = (NSMidX(aRect) - ([grip size].width/2));
32 gripRect.size.width = 8;
35 [bar drawInRect:aRect fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0];
36 [grip drawInRect:gripRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
40 - (CGFloat)dividerThickness