1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import Cocoa
- class KMTabStripController: CTTabStripController {
-
- override func layoutTabs() {
- let cnt = self.viewsCount()
- if cnt <= 1 {
- super.layoutTabs()
- return
- }
- guard let tabView = self.view(at: cnt-1) else {
- super.layoutTabs()
- return
- }
- let newTab = tabView.isHidden
- if newTab == false {
- super.layoutTabs()
- return
- }
-
-
- guard let preTabView = self.view(at: cnt-2) else {
- super.layoutTabs()
- return
- }
- if NSMinX(tabView.frame) == 0 {
-
- tabView.frame.origin.x = NSMaxX(preTabView.frame)
- }
- super.layoutTabs()
- }
- }
|