mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
fix: added clock update in popup view if the name was changed. Also added updates to the popup settings lists (#2127)
This commit is contained in:
@@ -43,7 +43,7 @@ internal class Popup: PopupWrapper {
|
||||
var sorted = list.sorted(by: { $0.popupIndex < $1.popupIndex })
|
||||
var views = self.subviews.filter{ $0 is ClockView }.compactMap{ $0 as? ClockView }
|
||||
|
||||
if sorted.count != self.orderTableView.list.count {
|
||||
if sorted.count != self.orderTableView.list.count || self.orderTableView.window?.isVisible ?? false {
|
||||
self.orderTableView.list = sorted
|
||||
self.orderTableView.update()
|
||||
}
|
||||
@@ -149,7 +149,7 @@ private class ClockView: NSStackView {
|
||||
}
|
||||
|
||||
public func update(_ newClock: Clock_t) {
|
||||
if self.clock.tz != newClock.tz {
|
||||
if self.clock.tz != newClock.tz || self.clock.name != newClock.name {
|
||||
self.clock = newClock
|
||||
self.setTZ()
|
||||
}
|
||||
@@ -304,10 +304,6 @@ private class OrderTableView: NSView, NSTableViewDelegate, NSTableViewDataSource
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
deinit {
|
||||
NotificationCenter.default.removeObserver(self)
|
||||
}
|
||||
|
||||
public func update() {
|
||||
self.tableView.reloadData()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user