(fixes issue #425) by Markus Hitter, BezelStyle button shouldn't background drawing

This commit is contained in:
Dr. Rolf Jansen 2009-11-06 00:47:16 +00:00
parent 3c80fea0f8
commit 94d611ab3c
3 changed files with 3 additions and 5 deletions

View File

@ -285,6 +285,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
-(BOOL)isOpaque {
if(_bezelStyle==NSDisclosureBezelStyle)
return NO;
return ![self isTransparent] && [self isBordered];
}

View File

@ -632,7 +632,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
-(void)highlight:(BOOL)highlight withFrame:(NSRect)frame inView:(NSView *)view {
if(_isHighlighted!=highlight){
_isHighlighted=highlight;
[self drawWithFrame:frame inView:view];
}
}
@ -654,8 +653,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if(![self startTrackingAt:[event locationInWindow] inView:view])
return NO;
[self drawWithFrame:frame inView:view];
do{
NSPoint currentPoint;
BOOL isWithinCellFrame;
@ -699,8 +696,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}while(YES);
[self drawWithFrame:frame inView:view];
return result;
}

View File

@ -435,6 +435,7 @@ static NSMutableDictionary *cellClassDictionary = nil;
if(NSMouseInRect(point,[self bounds],[self isFlipped])){
[_cell highlight:YES withFrame:[self bounds] inView:self];
[self setNeedsDisplay:YES];
if([_cell trackMouse:event inRect:[self bounds] ofView:self untilMouseUp:NO]){
[_cell setState:![_cell state]];