X-Git-Url: http://git.ithinksw.org/ITKit.git/blobdiff_plain/40172152adfcef7971072e82b8eb226ecb9b127c..3055b035aa851467097d35d886890f272dc90ee7:/ITButtonCell.m diff --git a/ITButtonCell.m b/ITButtonCell.m index 938e571..30ac956 100755 --- a/ITButtonCell.m +++ b/ITButtonCell.m @@ -50,7 +50,18 @@ { if ( _subStyle == ITGrayRoundedBezelStyle ) { [self drawGrayRoundedBezelWithFrame:rect inView:controlView]; - [super drawInteriorWithFrame:rect inView:controlView]; + if ( [self attributedTitle] ) { + NSPoint stringOrigin; + NSSize stringSize; + stringSize = [[self attributedTitle] size]; + stringOrigin.x = rect.origin.x + (rect.size.width - stringSize.width)/2; + stringOrigin.y = (rect.origin.y + (rect.size.height - stringSize.height)/2) - 2; + [controlView lockFocus]; + [[self attributedTitle] drawAtPoint:stringOrigin]; + [controlView unlockFocus]; + } else { + [super drawInteriorWithFrame:rect inView:controlView]; + } [[controlView superview] setNeedsDisplay:YES]; } else { [super drawWithFrame:rect inView:controlView]; @@ -69,7 +80,7 @@ NSPoint pointD = NSMakePoint( (ch / 2) , ch ); NSPoint lCtr = NSMakePoint( (ch / 2) , (ch / 2) ); NSPoint rCtr = NSMakePoint( (cw - (ch / 2)) , (ch / 2) ); - float alpha = 0.35; + float alpha = 0.45; [path moveToPoint:pointA]; [path lineToPoint:pointB]; @@ -84,10 +95,10 @@ endAngle:270.0]; if ( [self isHighlighted] ) { - alpha = 0.50; + alpha = 0.60; } - [[NSColor colorWithCalibratedWhite:0.0 alpha:alpha] set]; + [[NSColor colorWithCalibratedWhite:0.15 alpha:alpha] set]; [path fill]; }