From 7596c667030763f3849aacde5d11c2b99283150b Mon Sep 17 00:00:00 2001 From: David Richardson Date: Mon, 31 Oct 2016 16:21:46 -0600 Subject: [PATCH 1/3] Fix CPBox drawing artifacts when used in CPSeparator mode Suppress title positioning when CPBox used as a line or separator - by definition the title is null. --- Tools/nib2cib/NSBox.j | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tools/nib2cib/NSBox.j b/Tools/nib2cib/NSBox.j index 1eb41f67a..a3b3ba632 100644 --- a/Tools/nib2cib/NSBox.j +++ b/Tools/nib2cib/NSBox.j @@ -71,9 +71,8 @@ } _title = [[aCoder decodeObjectForKey:@"NSTitleCell"] objectValue] || @""; - _titlePosition = [aCoder decodeObjectForKey:@"NSTitlePosition"]; - if (_titlePosition === undefined) + if (_titlePosition === undefined && _boxType !== CPBoxSeparator) _titlePosition = CPAtTop; } From b02e4c530834f0ff88440d247fcbe2899085dc28 Mon Sep 17 00:00:00 2001 From: David Richardson Date: Mon, 16 Jan 2017 11:23:32 -0700 Subject: [PATCH 2/3] Handle case when CPBox is used as a separator line having no title If _titlePosition is correctly set to CPNoTitle value, class already handles removing title view from display. Previously, _titlePosition was not correctly set, title view was left in place. With no supplied value for title, outline of title view was rendered with visible artifacts. --- AppKit/CPBox.j | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/AppKit/CPBox.j b/AppKit/CPBox.j index 9ab1d47d1..dd8c35192 100644 --- a/AppKit/CPBox.j +++ b/AppKit/CPBox.j @@ -630,7 +630,11 @@ var CPBoxTypeKey = @"CPBoxTypeKey", [_contentView setSubviews:[malformedContentView subviews]]; [self replaceSubview:malformedContentView with:_contentView]; } - + else + { + _titlePosition = CPNoTitle; + } + [self setAutoresizesSubviews:YES]; [_contentView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable]; From 1816274ebe0902584bdf75e2c6f59f29eb46660a Mon Sep 17 00:00:00 2001 From: David Richardson Date: Tue, 17 Jan 2017 11:59:26 -0700 Subject: [PATCH 3/3] Revert "Fix CPBox drawing artifacts when used in CPSeparator mode" This reverts commit 7596c667030763f3849aacde5d11c2b99283150b. --- Tools/nib2cib/NSBox.j | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tools/nib2cib/NSBox.j b/Tools/nib2cib/NSBox.j index a3b3ba632..1eb41f67a 100644 --- a/Tools/nib2cib/NSBox.j +++ b/Tools/nib2cib/NSBox.j @@ -71,8 +71,9 @@ } _title = [[aCoder decodeObjectForKey:@"NSTitleCell"] objectValue] || @""; + _titlePosition = [aCoder decodeObjectForKey:@"NSTitlePosition"]; - if (_titlePosition === undefined && _boxType !== CPBoxSeparator) + if (_titlePosition === undefined) _titlePosition = CPAtTop; }