indragiek / INAppStoreWindow

NSWindow subclass with a highly customizable title bar and traffic lights
BSD 2-Clause "Simplified" License
1.06k stars 162 forks source link

Traffic light buttons #207

Open kalvish21 opened 8 years ago

kalvish21 commented 8 years ago

I use the default traffic light buttons on OSX. For some strange reason when I do beginSheet on my app and show an NSWindow, the traffic light buttons go to the top. Right now the height is 38 on the titleBar.

Is there a way to fix this?

fancymax commented 8 years ago

@kalvish21

a workaround here(Swift):

        let aWindow = self.window as! INAppStoreWindow
        aWindow.titleBarDrawingBlock = {[unowned self] drawsAsMainWindow, drawingRect, edge, clippingPath  in
            NSNotificationCenter.defaultCenter().postNotificationName(NSWindowDidMoveNotification, object:self.window)
        }
kalvish21 commented 8 years ago

Can I know waht this code does? and which version of swift?