mirror of
https://github.com/seemoo-lab/openhaystack.git
synced 2026-02-14 17:49:54 +00:00
Added a fix for the cropped rows on macOS 11.3
This is clearly a SwiftUI bug and it has been reported with FB9092071
This commit is contained in:
@@ -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) })
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user