diff --git a/OpenHaystack/OpenHaystack/HaystackApp/Views/AccessoryListEntry.swift b/OpenHaystack/OpenHaystack/HaystackApp/Views/AccessoryListEntry.swift index 3d80716..0305785 100644 --- a/OpenHaystack/OpenHaystack/HaystackApp/Views/AccessoryListEntry.swift +++ b/OpenHaystack/OpenHaystack/HaystackApp/Views/AccessoryListEntry.swift @@ -64,6 +64,7 @@ struct AccessoryListEntry: View { .fill(accessory.isNearby ? Color.green : accessory.isActive ? Color.orange : Color.red) .frame(width: 8, height: 8) } + .listRowBackground(Color.clear) .padding(EdgeInsets(top: 5, leading: 0, bottom: 5, trailing: 0)) .contextMenu { Button("Delete", action: { self.delete(accessory) }) diff --git a/OpenHaystack/OpenHaystack/HaystackApp/Views/ManageAccessoriesView.swift b/OpenHaystack/OpenHaystack/HaystackApp/Views/ManageAccessoriesView.swift index 7b1f89d..f43062b 100644 --- a/OpenHaystack/OpenHaystack/HaystackApp/Views/ManageAccessoriesView.swift +++ b/OpenHaystack/OpenHaystack/HaystackApp/Views/ManageAccessoriesView.swift @@ -56,6 +56,7 @@ struct ManageAccessoriesView: View { /// Accessory List view. var accessoryList: some View { + List(self.accessories, id: \.self, selection: $focusedAccessory) { accessory in AccessoryListEntry( accessory: accessory, @@ -74,9 +75,10 @@ struct ManageAccessoriesView: View { alertType: self.$alertType, delete: self.delete(accessory:), deployAccessoryToMicrobit: self.deploy(accessory:), - zoomOn: { self.focusedAccessory = $0 }) + zoomOn: { self.focusedAccessory = $0 } + ) } - .listStyle(SidebarListStyle()) + .listStyle(PlainListStyle()) } @@ -271,3 +273,11 @@ struct ManageAccessoriesView_Previews: PreviewProvider { ManageAccessoriesView(alertType: self.$alertType, focusedAccessory: self.$focussed, accessoryToDeploy: self.$deploy, showESP32DeploySheet: self.$showESPSheet) } } + +//FIXME: This is a workaround, because the List with Default style (and clear background) started to crop the rows on macOS 11.3 +extension NSTableView { + open override func viewDidMoveToWindow() { + super.viewDidMoveToWindow() + self.backgroundColor = .clear + } +}