[macos] refactoring

This commit is contained in:
maxkadushkin
2024-02-26 23:26:56 +03:00
parent 341ab8132b
commit f65eaa20a0
2 changed files with 10 additions and 4 deletions

View File

@ -98,7 +98,7 @@
NSView * superview = view.superview;
view.translatesAutoresizingMaskIntoConstraints = NO;
// leading
[superview addConstraint:[NSLayoutConstraint constraintWithItem:view
attribute:NSLayoutAttributeLeading
@ -116,10 +116,17 @@
multiplier:1
constant:0]];
// width
// [superview addConstraint:[NSLayoutConstraint constraintWithItem:superview
// attribute:NSLayoutAttributeWidth
// relatedBy:NSLayoutRelationEqual
// toItem:view attribute:NSLayoutAttributeWidth
// multiplier:1
// constant:0]];
// width
[superview addConstraint:[NSLayoutConstraint constraintWithItem:superview
attribute:NSLayoutAttributeWidth
attribute:NSLayoutAttributeTrailing
relatedBy:NSLayoutRelationEqual
toItem:view attribute:NSLayoutAttributeWidth
toItem:view attribute:NSLayoutAttributeTrailing
multiplier:1
constant:0]];
// height

View File

@ -283,7 +283,6 @@ static NSUInteger const kASTabViewCloseButtonSize = 12;
CGFloat btnCloseOriginLeft = -([self userInterfaceLayoutDirection] == NSUserInterfaceLayoutDirectionRightToLeft ?
CGRectGetWidth(rect) - kASTabViewCloseButtonSize / 1.5 : kASTabViewCloseButtonSize * 1.5);
NSLog(@"tabview btn close origin %f %@", btnCloseOriginLeft, NSStringFromRect(rect));
[self.close setFrame:CGRectMake(btnCloseOriginLeft,
kASTabViewCloseButtonSize / 1.5,
kASTabViewCloseButtonSize,