mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-15 00:34:08 +09:00
fix: added a listener for window open to the dashboard view (#1237)
This commit is contained in:
@@ -31,12 +31,18 @@ class Dashboard: NSStackView {
|
||||
scrollView.stackView.addArrangedSubview(self.specs())
|
||||
|
||||
self.addArrangedSubview(scrollView)
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(windowOpens), name: .openModuleSettings, object: nil)
|
||||
}
|
||||
|
||||
required public init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
deinit {
|
||||
NotificationCenter.default.removeObserver(self, name: .openModuleSettings, object: nil)
|
||||
}
|
||||
|
||||
private func versions() -> NSView {
|
||||
let container: NSGridView = NSGridView()
|
||||
container.rowSpacing = 0
|
||||
@@ -116,6 +122,7 @@ class Dashboard: NSStackView {
|
||||
}
|
||||
|
||||
@objc private func windowOpens(_ notification: Notification) {
|
||||
print(1)
|
||||
guard notification.userInfo?["module"] as? String == "Dashboard" else {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user