@@ -53,13 +53,13 @@ - (instancetype)initWithFrame:(NSRect)frameRect tabline:(MMTabline *)tabline
5353
5454 NSDictionary *viewDict = NSDictionaryOfVariableBindings(_closeButton, _titleLabel);
5555 [self addConstraints: [NSLayoutConstraint constraintsWithVisualFormat: @" H:|-9-[_closeButton]-(>=5)-[_titleLabel]-(>=16)-|" options: NSLayoutFormatAlignAllCenterY metrics: nil views: viewDict]];
56- [self addConstraint: [NSLayoutConstraint constraintWithItem: self attribute: NSLayoutAttributeCenterY relatedBy: NSLayoutRelationEqual toItem: _titleLabel attribute: NSLayoutAttributeCenterY multiplier: 1 constant: - 2 ]];
56+ [self addConstraint: [NSLayoutConstraint constraintWithItem: self attribute: NSLayoutAttributeCenterY relatedBy: NSLayoutRelationEqual toItem: _titleLabel attribute: NSLayoutAttributeCenterY multiplier: 1 constant: 0 ]];
5757 NSLayoutConstraint *centerConstraint = [NSLayoutConstraint constraintWithItem: self attribute: NSLayoutAttributeCenterX relatedBy: NSLayoutRelationEqual toItem: _titleLabel attribute: NSLayoutAttributeCenterX multiplier: 1 constant: 0 ];
5858 centerConstraint.priority = NSLayoutPriorityFittingSizeCompression +1 ;
5959 [self addConstraint: centerConstraint];
6060
6161 _shadow = [NSShadow new ];
62- _shadow.shadowColor = [NSColor colorWithWhite: 0 alpha: 0.4 ];
62+ _shadow.shadowColor = [NSColor colorWithWhite: 0 alpha: 0.3 ];
6363 _shadow.shadowBlurRadius = 2 ;
6464
6565 self.state = MMTabStateUnselected;
@@ -143,13 +143,22 @@ - (void)drawRect:(NSRect)dirtyRect
143143 [self .fillColor set ];
144144 CGFloat maxX = NSMaxX (self.bounds );
145145 NSBezierPath *p = [NSBezierPath new ];
146- [p moveToPoint: NSZeroPoint ];
147- [p lineToPoint: NSMakePoint (5.41 , 20.76 )];
148- [p curveToPoint: NSMakePoint (8.32 , 23 ) controlPoint1: NSMakePoint (5.76 , 22.08 ) controlPoint2: NSMakePoint (6.95 , 23 )];
149- [p lineToPoint: NSMakePoint (maxX - 8.32 , 23 )];
150- [p curveToPoint: NSMakePoint (maxX - 5.41 , 20.76 ) controlPoint1: NSMakePoint (maxX - 6.95 , 23 ) controlPoint2: NSMakePoint (maxX - 5.76 , 22.08 )];
151- [p lineToPoint: NSMakePoint (maxX, 0 )];
146+ [p moveToPoint: NSMakePoint ( 2 , 0 ) ];
147+ [p lineToPoint: NSMakePoint (5.6 , 20.5 )];
148+ [p curveToPoint: NSMakePoint (8.5 , 23 ) controlPoint1: NSMakePoint (5.8 , 22 ) controlPoint2: NSMakePoint (7.1 , 23 )];
149+ [p lineToPoint: NSMakePoint (maxX - 8.5 , 23 )];
150+ [p curveToPoint: NSMakePoint (maxX - 5.6 , 20.5 ) controlPoint1: NSMakePoint (maxX - 7.1 , 23 ) controlPoint2: NSMakePoint (maxX - 5.8 , 22 )];
151+ [p lineToPoint: NSMakePoint (maxX - 2 , 0 )];
152152 [p closePath ];
153+ // On macOS 11, translate the tab down 0.5pt to provide a thin
154+ // line between the top of the tab and the window's title bar.
155+ // It looks better given the new way macOS 11 draws title bars.
156+ // Older macOS versions don't need this.
157+ if (@available (macOS 11.0 , *)) {
158+ NSAffineTransform *transform = [NSAffineTransform new ];
159+ [transform translateXBy: 0 yBy: -0.5 ];
160+ [p transformUsingAffineTransform: transform];
161+ }
153162 [p fill ];
154163}
155164
0 commit comments