|
|
@ -5,29 +5,26 @@ import CoreLoggerKit |
|
|
|
import EventKit |
|
|
|
import EventKit |
|
|
|
|
|
|
|
|
|
|
|
class ClockerTextBackgroundView: NSView { |
|
|
|
class ClockerTextBackgroundView: NSView { |
|
|
|
private var themeDidChangeNotification: NSObjectProtocol? |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override func awakeFromNib() { |
|
|
|
override func awakeFromNib() { |
|
|
|
wantsLayer = true |
|
|
|
wantsLayer = true |
|
|
|
layer?.cornerRadius = 8.0 |
|
|
|
layer?.cornerRadius = 8.0 |
|
|
|
layer?.masksToBounds = false |
|
|
|
layer?.masksToBounds = false |
|
|
|
layer?.backgroundColor = Themer.shared().textBackgroundColor().cgColor |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
themeDidChangeNotification = NotificationCenter.default.addObserver(forName: .themeDidChangeNotification, object: nil, queue: OperationQueue.main) { _ in |
|
|
|
|
|
|
|
self.layer?.backgroundColor = Themer.shared().textBackgroundColor().cgColor |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
deinit { |
|
|
|
NotificationCenter.default.addObserver(self, |
|
|
|
if let themeDidChangeNotif = themeDidChangeNotification { |
|
|
|
selector: #selector(updateBackgroundColor), |
|
|
|
NotificationCenter.default.removeObserver(themeDidChangeNotif) |
|
|
|
name: .themeDidChangeNotification, |
|
|
|
} |
|
|
|
object: nil) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override func updateLayer() { |
|
|
|
override func updateLayer() { |
|
|
|
super.updateLayer() |
|
|
|
super.updateLayer() |
|
|
|
layer?.backgroundColor = Themer.shared().textBackgroundColor().cgColor |
|
|
|
layer?.backgroundColor = Themer.shared().textBackgroundColor().cgColor |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@objc func updateBackgroundColor() { |
|
|
|
|
|
|
|
layer?.backgroundColor = Themer.shared().textBackgroundColor().cgColor |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class CalendarViewController: ParentViewController { |
|
|
|
class CalendarViewController: ParentViewController { |
|
|
|