5 // Created by Evan Schoenberg on 6/30/06.
8 #import "ESGlassSplitView.h"
9 #import <Adium/KNShelfSplitView.h>
10 #import <AIUtilities/AIImageAdditions.h>
12 @implementation ESGlassSplitView
13 - (void)_initGlassSplitView
15 background = [[NSImage imageNamed:@"sourceListBackground" forClass:[KNShelfSplitView class]] retain];
16 backgroundSize = [background size];
18 [self setNeedsDisplay:YES];
21 - (id)initWithCoder:(NSCoder *)inCoder
23 if ((self = [super initWithCoder:inCoder])) {
24 [self _initGlassSplitView];
30 - (id)initWithFrame:(NSRect)frame
32 if ((self = [super initWithFrame:frame])) {
33 [self _initGlassSplitView];
46 -(void)drawDividerInRect:(NSRect)aRect
48 //Draw the background, tiling across
49 NSRect sourceRect = NSMakeRect(0, 0, backgroundSize.width, backgroundSize.height);
50 NSRect destRect = NSMakeRect(aRect.origin.x, aRect.origin.y, sourceRect.size.width, aRect.size.width);
52 while ((NSMinX(destRect) < NSMaxX(aRect)) && NSWidth(destRect) > 0) {
54 if (NSMaxX(destRect) > NSMaxX(aRect)) {
55 sourceRect.size.width = NSWidth(destRect);
58 [background drawInRect:destRect
60 operation:NSCompositeSourceOver
62 destRect.origin.x += NSWidth(destRect);
66 [[NSColor windowFrameColor] set];
67 NSRectFill(NSMakeRect(aRect.origin.x, aRect.origin.y, aRect.size.width, 1.0));
68 NSRectFill(NSMakeRect(aRect.origin.x, aRect.origin.y + aRect.size.height - 1, aRect.size.width, 1.0));
71 //[[NSColor blackColor] set];
72 NSBezierPath *ovalPath = [NSBezierPath bezierPathWithOvalInRect:NSMakeRect(aRect.origin.x + (aRect.size.width / 2.0) - 2,
73 aRect.origin.y + (aRect.size.height / 2.0) - 2,
77 [[[NSColor lightGrayColor] colorWithAlphaComponent:0.5] set];
80 [ovalPath setLineWidth:0];
81 [[NSColor windowFrameColor] set];