mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
fix: added placeholder to the disks list in the popup settings when no disks show because the module is disabled (#2383)
This commit is contained in:
@@ -107,6 +107,10 @@ internal class Popup: PopupWrapper {
|
||||
self.lastList = value.array.compactMap{ $0.uuid }
|
||||
}
|
||||
|
||||
if self.settingsSection.contains("empty_view") {
|
||||
self.settingsSection.delete("empty_view")
|
||||
}
|
||||
|
||||
self.lastList.filter { !value.map { $0.uuid }.contains($0) }.forEach { self.settingsSection.delete($0) }
|
||||
value.forEach { (drive: drive) in
|
||||
if !self.settingsSection.contains(drive.uuid) {
|
||||
@@ -216,6 +220,9 @@ internal class Popup: PopupWrapper {
|
||||
))
|
||||
]))
|
||||
|
||||
let empty = NSView()
|
||||
empty.identifier = NSUserInterfaceItemIdentifier("empty_view")
|
||||
self.settingsSection.add(empty)
|
||||
view.addArrangedSubview(self.settingsSection)
|
||||
|
||||
return view
|
||||
|
||||
Reference in New Issue
Block a user