From 8340791824ad52b4aacb19533e5d004373897a86 Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Fri, 23 Apr 2010 16:34:47 -0700 Subject: [PATCH] Don't let color wells work if they are disabled. Closes #626. --- AppKit/CPColorWell.j | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/AppKit/CPColorWell.j b/AppKit/CPColorWell.j index 2c2586821a..040e5c5483 100644 --- a/AppKit/CPColorWell.j +++ b/AppKit/CPColorWell.j @@ -231,11 +231,17 @@ 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])]; } @@ -243,7 +249,7 @@ var _CPColorWellDidBecomeExclusiveNotification = @"_CPColorWellDidBecomeExclusiv { [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];