From f65eaa20a030ceddead80527be313b2bab6d96e2 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Mon, 26 Feb 2024 23:26:56 +0300 Subject: [PATCH] [macos] refactoring --- .../MainWindow/ASCTitleWindowController.mm | 13 ++++++++++--- macos/ONLYOFFICE/Code/Controls/ASCTabs/ASCTabView.m | 1 - 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/macos/ONLYOFFICE/Code/Controllers/MainWindow/ASCTitleWindowController.mm b/macos/ONLYOFFICE/Code/Controllers/MainWindow/ASCTitleWindowController.mm index 652a188f2..febd0e526 100644 --- a/macos/ONLYOFFICE/Code/Controllers/MainWindow/ASCTitleWindowController.mm +++ b/macos/ONLYOFFICE/Code/Controllers/MainWindow/ASCTitleWindowController.mm @@ -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 diff --git a/macos/ONLYOFFICE/Code/Controls/ASCTabs/ASCTabView.m b/macos/ONLYOFFICE/Code/Controls/ASCTabs/ASCTabView.m index b0f117292..fd351dd3a 100644 --- a/macos/ONLYOFFICE/Code/Controls/ASCTabs/ASCTabView.m +++ b/macos/ONLYOFFICE/Code/Controls/ASCTabs/ASCTabView.m @@ -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,