Skip to content

Commit

Permalink
Don't let color wells work if they are disabled.
Browse files Browse the repository at this point in the history
Closes #626.
  • Loading branch information
Ross Boucher committed Apr 23, 2010
1 parent 14f0d16 commit 8340791
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion AppKit/CPColorWell.j
Expand Up @@ -231,19 +231,25 @@ var _CPColorWellDidBecomeExclusiveNotification = @"_CPColorWellDidBecomeExclusiv

- (void)mouseDown:(CPEvent)anEvent
{
if (![self isEnabled])
return;

[self drawBezelWithHighlight:YES];
}

- (void)mouseDragged:(CPEvent)anEvent
{
if (![self isEnabled])
return;

[self drawBezelWithHighlight:CGRectContainsPoint([self bounds], [self convertPoint:[anEvent locationInWindow] fromView:nil])];
}

-(void)mouseUp:(CPEvent)anEvent
{
[self drawBezelWithHighlight:NO];

if (!CGRectContainsPoint([self bounds], [self convertPoint:[anEvent locationInWindow] fromView:nil]))
if (!CGRectContainsPoint([self bounds], [self convertPoint:[anEvent locationInWindow] fromView:nil]) || ![self isEnabled])
return;

[self activate:YES];
Expand Down

0 comments on commit 8340791

Please sign in to comment.