Implement _hasEqualSpacing

This commit is contained in:
Gregory John Casamento 2021-05-17 06:15:56 -04:00
parent 3fd0f590f4
commit b5f820d052
2 changed files with 10 additions and 7 deletions

View file

@ -79,6 +79,7 @@ static const CGFloat NSStackViewSpacingUseDefault = FLT_MAX;
CGFloat _spacing;
BOOL _detachesHiddenViews;
BOOL _hasFlagViewHierarchy;
BOOL _hasEqualSpacing;
NSMutableArray *_arrangedSubviews;
NSMutableArray *_detachedViews;
NSMutableArray *_views;

View file

@ -179,10 +179,13 @@
- (void) setCustomSpacing: (CGFloat)spacing afterView: (NSView *)v
{
NSNumber *n = [NSNumber numberWithFloat: spacing];
[_customSpacingMap setObject: n
forKey: v];
[self _refreshView];
if (_hasEqualSpacing == NO)
{
NSNumber *n = [NSNumber numberWithFloat: spacing];
[_customSpacingMap setObject: n
forKey: v];
[self _refreshView];
}
}
- (CGFloat) customSpacingAfterView: (NSView *)v
@ -281,13 +284,12 @@
- (void) setHasEqualSpacing: (BOOL)f
{
// deprecated
_hasEqualSpacing = f;
}
- (BOOL) hasEqualSpacing
{
// deprecated
return NO;
return _hasEqualSpacing;
}
- (void)addView: (NSView *)view inGravity: (NSStackViewGravity)gravity