Adding theme method for NSBrowser drawing.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31658 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2010-11-26 19:49:04 +00:00
parent 538432c72f
commit eac1ad07ad
4 changed files with 99 additions and 68 deletions

View file

@ -2324,73 +2324,10 @@ static NSTextFieldCell *titleCell;
- (void) drawRect: (NSRect)rect
{
// Load the first column if not already done
if (!_isLoaded)
{
[self loadColumnZero];
}
// Draws titles
if (_isTitled)
{
int i;
for (i = _firstVisibleColumn; i <= _lastVisibleColumn; ++i)
{
NSRect titleRect = [self titleFrameOfColumn: i];
if (NSIntersectsRect (titleRect, rect) == YES)
{
[self drawTitleOfColumn: i
inRect: titleRect];
}
}
}
// Draws scroller border
if (_hasHorizontalScroller && _separatesColumns)
{
NSRect scrollerBorderRect = _scrollerRect;
NSSize bs = [[GSTheme theme] sizeForBorderType: NSBezelBorder];
scrollerBorderRect.origin.x = 0;
scrollerBorderRect.origin.y = 0;
scrollerBorderRect.size.width += 2 * bs.width;
scrollerBorderRect.size.height += (2 * bs.height) - 1;
if ((NSIntersectsRect (scrollerBorderRect, rect) == YES) && _window)
{
[[GSTheme theme] drawGrayBezel: scrollerBorderRect withClip: rect];
}
}
if (!_separatesColumns)
{
NSPoint p1,p2;
int i, visibleColumns;
float hScrollerWidth = _hasHorizontalScroller ? scrollerWidth : 0;
// Columns borders
[[GSTheme theme] drawGrayBezel: _bounds withClip: rect];
[[NSColor blackColor] set];
visibleColumns = [self numberOfVisibleColumns];
for (i = 1; i < visibleColumns; i++)
{
p1 = NSMakePoint((_columnSize.width * i) + 2 + (i-1),
_columnSize.height + hScrollerWidth + 2);
p2 = NSMakePoint((_columnSize.width * i) + 2 + (i-1),
hScrollerWidth + 2);
[NSBezierPath strokeLineFromPoint: p1 toPoint: p2];
}
// Horizontal scroller border
if (_hasHorizontalScroller)
{
p1 = NSMakePoint(2, hScrollerWidth + 2);
p2 = NSMakePoint(rect.size.width - 2, hScrollerWidth + 2);
[NSBezierPath strokeLineFromPoint: p1 toPoint: p2];
}
}
[[GSTheme theme] drawBrowserRect: rect
inView: self
withScrollerRect: _scrollerRect
columnSize: _columnSize];
}
/* Informs the receivers's subviews that the receiver's bounds