Restore CPTableView and CPView theme attribute class defaults

Restore the main-branch class defaults for alternating row colors
(white and RGB 245, 249, 252) and grid color (`#dce0e2`) in
`CPTableView`, and for `nib2cib-adjustment-frame` (a zero rect) in
`CPView`, while letting theme values take precedence.
This commit is contained in:
David Richardson committed 2026-11-27 14:18:25 -06:00
1 parent 3cdd28bba7
commit b1c762aaf9
2 files changed
+15 -3

No files matched your search

+8 -2
View File
@@ -330,11 +330,17 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
/*!
@ignore
*/
/*
2026-11-27: a table view whose theme gave no grid colour or alternating row colours drew
with none. Cause: the class defaults were changed to null when the table view was
reworked. AppKit gives every table view a grid colour and alternating row colours, so the
class defaults are restored.
*/
+ (CPDictionary)themeAttributes
{
return @{
@"alternating-row-colors": [CPNull null],
@"grid-color": [CPNull null],
@"alternating-row-colors": @[[CPColor whiteColor], [CPColor colorWithRed:245.0 / 255.0 green:249.0 / 255.0 blue:252.0 / 255.0 alpha:1.0]],
@"grid-color": [CPColor colorWithHexString:@"dce0e2"],
@"grid-line-thickness": 1.0,
@"highlighted-grid-color": [CPNull null],
@"selection-color": [CPNull null],
+7 -1
View File
@@ -351,11 +351,17 @@ function _CPViewResolvedColorsAreSame(aColor, anotherColor)
return @"view";
}
/*
2026-11-27: a view whose theme gave no nib2cib-adjustment-frame read nil instead of a zero
rect. Cause: the class default was changed to null when Aristo3 was added. A zero rect leaves
the frame unchanged, and a caller that offsets the adjustment, such as nib2cib's NSButton,
can rely on a rect.
*/
+ (CPDictionary)themeAttributes
{
return @{
@"css-based": NO,
@"nib2cib-adjustment-frame": [CPNull null],
@"nib2cib-adjustment-frame": CGRectMakeZero(),
@"direct-nib2cib-adjustment": NO,
@"dynamic-set": [CPNull null]
};