From 858816107a56afc950e2c39f86e4adedd8d1aafb Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Fri, 7 Feb 2025 21:21:34 +0100 Subject: [PATCH] fix: added placeholder to the disks list in the popup settings when no disks show because the module is disabled (#2383) --- Modules/Disk/popup.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Modules/Disk/popup.swift b/Modules/Disk/popup.swift index b0122676..8c0c919a 100644 --- a/Modules/Disk/popup.swift +++ b/Modules/Disk/popup.swift @@ -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