1
0
镜像自地址 https://github.com/maxgoedjen/secretive.git 已同步 2026-03-27 19:47:24 +01:00

Fix popovers not showing on Sonoma beta (#477)

* Use .rect(bounds) on Sonoma.

* Comment
这个提交包含在:
Max Goedjen
2023-07-23 17:35:28 -04:00
提交者 GitHub
父节点 1d4ef12546
当前提交 5bf5be6c25

查看文件

@@ -88,7 +88,7 @@ extension ContentView {
.foregroundColor(.white) .foregroundColor(.white)
}) })
.buttonStyle(ToolbarButtonStyle(color: color)) .buttonStyle(ToolbarButtonStyle(color: color))
.popover(item: $selectedUpdate, attachmentAnchor: .point(.bottom), arrowEdge: .bottom) { update in .popover(item: $selectedUpdate, attachmentAnchor: attachmentAnchor, arrowEdge: .bottom) { update in
UpdateDetailView(update: update) UpdateDetailView(update: update)
} }
} }
@@ -147,7 +147,7 @@ extension ContentView {
} }
}) })
.buttonStyle(ToolbarButtonStyle(lightColor: .black.opacity(0.05), darkColor: .white.opacity(0.05))) .buttonStyle(ToolbarButtonStyle(lightColor: .black.opacity(0.05), darkColor: .white.opacity(0.05)))
.popover(isPresented: $showingAgentInfo, attachmentAnchor: .point(.bottom), arrowEdge: .bottom) { .popover(isPresented: $showingAgentInfo, attachmentAnchor: attachmentAnchor, arrowEdge: .bottom) {
VStack { VStack {
Text("SecretAgent is Running") Text("SecretAgent is Running")
.font(.title) .font(.title)
@@ -172,7 +172,7 @@ extension ContentView {
.foregroundColor(.white) .foregroundColor(.white)
}) })
.buttonStyle(ToolbarButtonStyle(color: .orange)) .buttonStyle(ToolbarButtonStyle(color: .orange))
.popover(isPresented: $showingAppPathNotice, attachmentAnchor: .point(.bottom), arrowEdge: .bottom) { .popover(isPresented: $showingAppPathNotice, attachmentAnchor: attachmentAnchor, arrowEdge: .bottom) {
VStack { VStack {
Image(systemName: "exclamationmark.triangle") Image(systemName: "exclamationmark.triangle")
.resizable() .resizable()
@@ -186,6 +186,11 @@ extension ContentView {
} }
} }
var attachmentAnchor: PopoverAttachmentAnchor {
// Ideally .point(.bottom), but broken on Sonoma (FB12726503)
.rect(.bounds)
}
} }
#if DEBUG #if DEBUG