         }
         self.tabView?.addTabViewItem(item)
         if tabItemViews().count == 1 {
+            if let constraint = addTabButtonHeightConstraint, let aTabView = self.tabItemViews().first {
+                let height = aTabView.intrinsicContentSize.height
+                constraint.active = false
+                addTabButtonHeightConstraint = addTabButton.heightAnchor.constraintEqualToConstant(height)
+                addTabButtonHeightConstraint?.active = true
+            }
             self.invalidateIntrinsicContentSize()
         }
         selectTabViewItem(item)

    override public var intrinsicContentSize: NSSize {
        var height : CGFloat = 22;
        if let aTabView = self.tabItemViews().first {
            height = aTabView.intrinsicContentSize.height+2
        }
        if let constraint = addTabButtonHeightConstraint {
            constraint.active = false
            addTabButtonHeightConstraint = addTabButton.heightAnchor.constraintEqualToConstant(height)
            addTabButtonHeightConstraint?.active = true
        }
        return NSMakeSize(NSViewNoIntrinsicMetric, height)
    }

    public override func drawRect(dirtyRect: NSRect) {
        self.backgroundColor.setFill()
        NSRectFill(self.bounds)
        for tabView in self.tabItemViews() {
            var rect = NSInsetRect(tabView.frame, -0.5, -0.5)
            if self.selectedTabView() == tabView {
                rect = NSInsetRect(tabView.frame, 1, -0.5)
                selectedBorderColor.setStroke()
            } else {
                borderColor.setStroke()
            }
            let border = NSBezierPath(rect: rect)
            border.lineWidth = 1
            border.stroke()
        }
        let rect = addTabButton.frame
        self.backgroundColor.setFill()
        NSRectFill(rect)
        let border = NSBezierPath(rect: NSInsetRect(rect, -0.5, -0.5))
        borderColor.setStroke()
        border.stroke()
    }
