From b70abb730da876b364560fae50923d485fe2db56 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Mon, 9 Feb 2026 19:36:44 +0100 Subject: [PATCH] fixed: unfocussed selection color in column --- AppKit/CPTableView.j | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/AppKit/CPTableView.j b/AppKit/CPTableView.j index 93c497a4d..4536dca7f 100644 --- a/AppKit/CPTableView.j +++ b/AppKit/CPTableView.j @@ -638,7 +638,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5; if ([self selectionHighlightStyle] === CPTableViewSelectionHighlightStyleNone) return; - var color = [self selectionHighlightColor], + var color = [self _isFocused] ? [self selectionHighlightColor] : [self unfocusedSelectionHighlightColor], bounds = [self bounds]; // 3. Create a view for each selected column index @@ -5556,6 +5556,11 @@ Your delegate can implement this method to avoid subclassing the tableview to ad [self _updateAllVisibleRowViews]; // Ensure the text turns white [self _updateDataViewsFocusState]; + + // for symmetry with _notifyViewDidResignFirstResponder + setTimeout(function() { + [self _updateSelectedColumnBackgrounds]; + }, 0); } - (void)_notifyViewDidResignFirstResponder @@ -5564,6 +5569,11 @@ Your delegate can implement this method to avoid subclassing the tableview to ad [self _updateAllVisibleRowViews]; // Ensure the text turns black [self _updateDataViewsFocusState]; + + // needed because _isFocussed still returns true in this iteration of the run loop + setTimeout(function() { + [self _updateSelectedColumnBackgrounds]; + }, 0); } @end