From 304ab84d1432207f4882386193405aa8fcb760d3 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Thu, 11 Mar 2010 01:36:00 +0000 Subject: - Improve SPTextAndLinkCell by not following links when the starting click was outside the link cell. Thanks to Brian Dunagan for this improvement ( http://www.bdunagan.com/2010/02/25/create-itunes-link-arrows/ ) --- Source/SPTextAndLinkCell.m | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Source') diff --git a/Source/SPTextAndLinkCell.m b/Source/SPTextAndLinkCell.m index ac5cde0e..8eac562d 100644 --- a/Source/SPTextAndLinkCell.m +++ b/Source/SPTextAndLinkCell.m @@ -203,6 +203,9 @@ static inline NSRect SPTextLinkRectFromCellRect(NSRect inRect) if (!NSMouseInRect(p, linkRect, [controlView isFlipped])) return [super trackMouse:theEvent inRect:cellFrame ofView:controlView untilMouseUp:untilMouseUp]; + // Ignore events other than mouse down. + if ([theEvent type] != NSLeftMouseDown) return YES; + // Continue tracking the mouse while it's down, updating the state as it enters and leaves the cell, // until it is released; if still within the cell, follow the link. BOOL mouseInButton = YES; -- cgit v1.2.3