more display fine tuning of a table view in a scroll view

implemented NSEraseRect()
This commit is contained in:
Rolf Jansen 2015-10-06 22:49:17 -03:00 committed by Rolf
parent bbc801b7d4
commit 68884812bf
4 changed files with 16 additions and 3 deletions

View File

@ -85,6 +85,8 @@ APPKIT_EXPORT void NSRectFillListWithGrays(const NSRect *rects, const float *gra
APPKIT_EXPORT void NSRectFillList(const NSRect *rects, int count);
APPKIT_EXPORT void NSRectFill(NSRect rect);
APPKIT_EXPORT void NSEraseRect(NSRect rect);
APPKIT_EXPORT void NSRectFillListUsingOperation(const NSRect *rects, int count, NSCompositingOperation operation);
APPKIT_EXPORT void NSRectFillUsingOperation(NSRect rect, NSCompositingOperation operation);

View File

@ -124,6 +124,15 @@ void NSRectFill(NSRect rect) {
CGContextRestoreGState(context);
}
void NSEraseRect(NSRect rect) {
CGContextRef context=NSCurrentGraphicsPort();
CGContextSaveGState(context);
[[NSColor whiteColor] setFill];
CGContextSetBlendMode(context,kCGBlendModeCopy);
CGContextFillRect(NSCurrentGraphicsPort(),rect);
CGContextRestoreGState(context);
}
void NSRectFillListUsingOperation(const NSRect *rects,int count,NSCompositingOperation operation) {
CGContextRef context=NSCurrentGraphicsPort();
CGContextSaveGState(context);

View File

@ -172,7 +172,7 @@ static Class _rulerViewClass = nil;
break;
case NSBezelBorder:
bounds=NSInsetRect(bounds,2,2);
bounds=NSInsetRect(bounds,1,1);
break;
case NSGrooveBorder:

View File

@ -784,13 +784,15 @@ static inline RECT transformToRECT(O2AffineTransform matrix,NSRect rect) {
@implementation NSGraphicsStyle_uxtheme (NSTableView)
-(void)drawTableViewHeaderInRect:(NSRect)rect highlighted:(BOOL)highlighted {
rect.origin.y -= 1.0;
rect.origin.y -= 1.0;
rect.size.height += 1.0;
if(![self drawPartId:HP_HEADERITEM stateId:highlighted?HIS_PRESSED:HIS_NORMAL uxthClassId:uxthHEADER inRect:rect])
[super drawTableViewHeaderInRect:rect highlighted:highlighted];
}
-(void)drawTableViewCornerInRect:(NSRect)rect {
rect.origin.y -= 1.0;
rect.origin.y -= 1.0;
rect.size.height += 1.0;
if(![self drawPartId:HP_HEADERITEM stateId:HIS_NORMAL uxthClassId:uxthHEADER inRect:rect])
[super drawTableViewCornerInRect:rect];
}