aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-07-21 22:19:18 +0000
committerrowanbeentje <rowan@beent.je>2009-07-21 22:19:18 +0000
commit3c902c7e677ec36035a730aec01038fcebbd1ee0 (patch)
tree1c27f60dbf81fb6037a58c4dd8465a0e9319ea3c
parentb6ce7c756f63de03ea2d87aaa733751610ee2dee (diff)
downloadsequelpro-3c902c7e677ec36035a730aec01038fcebbd1ee0.tar.gz
sequelpro-3c902c7e677ec36035a730aec01038fcebbd1ee0.tar.bz2
sequelpro-3c902c7e677ec36035a730aec01038fcebbd1ee0.zip
- Clean up logic flow, moving column and row capture to within trackMouse:inRect:ofView:untilMouseUp: instead of hitTestForEvent:.
-rw-r--r--Source/SPTextAndLinkCell.m12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/SPTextAndLinkCell.m b/Source/SPTextAndLinkCell.m
index d1e8338e..eee3f517 100644
--- a/Source/SPTextAndLinkCell.m
+++ b/Source/SPTextAndLinkCell.m
@@ -177,12 +177,6 @@ static inline NSRect SPTextLinkRectFromCellRect(NSRect inRect) {
// Hit the link if it falls within the link rectangle for this cell, set when drawing
if (p.x > linkRect.origin.x && p.x < (linkRect.origin.x + linkRect.size.width)) {
- // Capture the clicked row and cell
- NSTableView *tableView = (NSTableView *)[self controlView];
- p = [[[NSApp mainWindow] contentView] convertPoint:[event locationInWindow] toView:tableView];
- lastLinkColumn = [tableView columnAtPoint:p];
- lastLinkRow = [tableView rowAtPoint:p];
-
// Return a trackable hit
return NSCellHitContentArea | NSCellHitTrackableArea;
@@ -222,6 +216,12 @@ static inline NSRect SPTextLinkRectFromCellRect(NSRect inRect) {
BOOL mouseClicked = [linkButton trackMouse:theEvent inRect:linkRect ofView:controlView untilMouseUp:NO];
if (mouseClicked) {
+ // Capture the clicked row and cell
+ NSTableView *tableView = (NSTableView *)[self controlView];
+ p = [[[NSApp mainWindow] contentView] convertPoint:[theEvent locationInWindow] toView:tableView];
+ lastLinkColumn = [tableView columnAtPoint:p];
+ lastLinkRow = [tableView rowAtPoint:p];
+
// Remove highlight, and follow the link
[linkButton highlight:NO withFrame:linkRect inView:controlView];
[linkTarget performSelector:linkAction withObject:self];