Added method to draw scroller using theme.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31656 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2010-11-26 19:16:46 +00:00
parent 8ed87de2f2
commit 538432c72f
4 changed files with 54 additions and 28 deletions

View file

@ -1786,4 +1786,39 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
DPSgrestore(ctxt);
}
- (void) drawScrollerRect: (NSRect)rect
inView: (NSView *)view
hitPart: (NSScrollerPart)hitPart
isHorizontal: (BOOL)isHorizontal
{
NSRect rectForPartIncrementLine;
NSRect rectForPartDecrementLine;
NSRect rectForPartKnobSlot;
NSScroller *scroller = (NSScroller *)view;
rectForPartIncrementLine = [scroller rectForPart: NSScrollerIncrementLine];
rectForPartDecrementLine = [scroller rectForPart: NSScrollerDecrementLine];
rectForPartKnobSlot = [scroller rectForPart: NSScrollerKnobSlot];
[[[view window] backgroundColor] set];
NSRectFill (rect);
if (NSIntersectsRect (rect, rectForPartKnobSlot) == YES)
{
[scroller drawKnobSlot];
[scroller drawKnob];
}
if (NSIntersectsRect (rect, rectForPartDecrementLine) == YES)
{
[scroller drawArrow: NSScrollerDecrementArrow
highlight: hitPart == NSScrollerDecrementLine];
}
if (NSIntersectsRect (rect, rectForPartIncrementLine) == YES)
{
[scroller drawArrow: NSScrollerIncrementArrow
highlight: hitPart == NSScrollerIncrementLine];
}
}
@end