From 34c7dededfa4e118d07ee1be342044e66798ef87 Mon Sep 17 00:00:00 2001 From: Alexandre Wilhelm Date: Fri, 24 Oct 2014 14:06:42 -0700 Subject: [PATCH] Fixed: hitTest method returns the wrong view in the CPTableView when the selectionStyle is set to CPTableViewSelectionHighlightStyleNone Previously, when having a CPTableView with a selectionStyle set to CPTableViewSelectionHighlightStyleNone, we needed two clicks to be able to select or click on a control of the cell. Now we only need one click as in Cocoa. This is fixed by changing the method hitTest and returning the good view which can become the firstResponder. --- AppKit/CPTableView.j | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AppKit/CPTableView.j b/AppKit/CPTableView.j index 2fe528208..6b7a5f528 100644 --- a/AppKit/CPTableView.j +++ b/AppKit/CPTableView.j @@ -5123,7 +5123,12 @@ Your delegate can implement this method to avoid subclassing the tableview to ad var hit = [super hitTest:aPoint]; if ([[CPApp currentEvent] type] == CPLeftMouseDown && [hit acceptsFirstResponder] && ![self isRowSelected:[self rowForView:hit]]) + { + if (_selectionHighlightStyle == CPTableViewSelectionHighlightStyleNone) + return hit; + return self; + } return hit; }