123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- //
- // KMWatermarkAdjectiveTopBarItemView.swift
- // PDF Reader Pro
- //
- // 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
- }
- }
-
- }
|