From e27bb4de5086aeb97b5f5ca27762d237d9665de9 Mon Sep 17 00:00:00 2001 From: Didier Korthoudt Date: Sun, 13 May 2018 19:47:53 +0200 Subject: [PATCH] FIXED: _CPTableColumnHeaderView was using hard coded values instead of theme values (#2703) --- AppKit/CPTableHeaderView.j | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/AppKit/CPTableHeaderView.j b/AppKit/CPTableHeaderView.j index 8ec2a5beb..971bfeaa8 100644 --- a/AppKit/CPTableHeaderView.j +++ b/AppKit/CPTableHeaderView.j @@ -66,18 +66,20 @@ - (void)_init { + var inset = [self valueForThemeAttribute:@"text-inset"]; + _textField = [[_CPImageAndTextView alloc] initWithFrame: - CGRectMake(5.0, 0.0, CGRectGetWidth([self bounds]) - 10.0, CGRectGetHeight([self bounds]))]; + CGRectMake(inset.left, inset.top, CGRectGetWidth([self bounds]) - (inset.left + inset.right), CGRectGetHeight([self bounds]) - (inset.top + inset.bottom))]; [_textField setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable]; - [_textField setLineBreakMode:CPLineBreakByTruncatingTail]; - [_textField setTextColor:[CPColor colorWithRed:51.0 / 255.0 green:51.0 / 255.0 blue:51.0 / 255.0 alpha:1.0]]; - [_textField setFont:[CPFont boldSystemFontOfSize:12.0]]; - [_textField setAlignment:CPLeftTextAlignment]; + [_textField setLineBreakMode:[self valueForThemeAttribute:@"line-break-mode"]]; + [_textField setTextColor:[self valueForThemeAttribute:@"text-color"]]; + [_textField setFont:[self valueForThemeAttribute:@"font"]]; + [_textField setAlignment:[self valueForThemeAttribute:@"text-alignment"]]; [_textField setVerticalAlignment:CPCenterVerticalTextAlignment]; - [_textField setTextShadowColor:[CPColor whiteColor]]; - [_textField setTextShadowOffset:CGSizeMake(0,1)]; + [_textField setTextShadowColor:[self valueForThemeAttribute:@"text-shadow-color"]]; + [_textField setTextShadowOffset:[self valueForThemeAttribute:@"text-shadow-offset"]]; [self addSubview:_textField]; }