mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 21:47:39 +00:00
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:
parent
8ed87de2f2
commit
538432c72f
4 changed files with 54 additions and 28 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue