Switch stuff to popovers to behave better in Big Sur (#163)

* Moving create to a popover.

* Switch to popover here too
This commit is contained in:
Max Goedjen 2020-11-11 16:45:39 -08:00 committed by GitHub
parent edf01cc6d4
commit 59ec40c611
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -23,11 +23,6 @@ struct ContentView<UpdaterType: UpdaterProtocol, AgentStatusCheckerType: AgentSt
NoStoresView()
}
}
.sheet(isPresented: $showingCreation) {
if let modifiable = storeList.modifiableStore {
CreateSecretView(store: modifiable, showing: $showingCreation)
}
}
.frame(minWidth: 640, minHeight: 320)
.toolbar {
updateNotice
@ -83,6 +78,12 @@ extension ContentView {
}, label: {
Image(systemName: "plus")
})
.popover(isPresented: $showingCreation, attachmentAnchor: .point(.bottom), arrowEdge: .bottom) {
if let modifiable = storeList.modifiableStore {
CreateSecretView(store: modifiable, showing: $showingCreation)
}
}
)
}
}

View File

@ -20,7 +20,7 @@ struct SecretListView: View {
}
}
}
.sheet(item: $deletingSecret) { secret in
.popover(isPresented: .constant(deletingSecret == secret)) {
if let modifiable = store as? AnySecretStoreModifiable {
DeleteSecretView(store: modifiable, secret: secret) { deleted in
deletingSecret = nil
@ -30,6 +30,7 @@ struct SecretListView: View {
}
}
}
}
}