// // KMWatermarkAdjectiveTopBarItemView.swift // PDF Master // // Created by tangchao on 2022/12/15. // import Cocoa class KMWatermarkAdjectiveTopBarItemLineView: NSView { } class KMWatermarkAdjectiveTopBarItemView: NSView { var button: NSButton! override init(frame frameRect: NSRect) { super.init(frame: frameRect) button = NSButton() button.isBordered = false self.addSubview(button) } required init?(coder: NSCoder) { super.init(coder: coder) } override func layout() { super.layout() button.frame = self.bounds } func isSelected(selected: Bool) { if (selected) { self.wantsLayer = true self.layer?.backgroundColor = NSColor(white: 0, alpha: 0.2).cgColor } else { self.wantsLayer = true self.layer?.backgroundColor = NSColor.clear.cgColor } } }