From 988b9b47932d436bbb5c6b7c5df582a08993cc17 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Fri, 7 Feb 2025 12:13:39 -0500 Subject: [PATCH] Hide compose attachment menu when there are no actions --- .../AttachmentCollectionViewCell.swift | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Packages/ComposeUI/Sources/ComposeUI/Views/Attachments/AttachmentCollectionViewCell.swift b/Packages/ComposeUI/Sources/ComposeUI/Views/Attachments/AttachmentCollectionViewCell.swift index 1081ba61a..1657cb4b1 100644 --- a/Packages/ComposeUI/Sources/ComposeUI/Views/Attachments/AttachmentCollectionViewCell.swift +++ b/Packages/ComposeUI/Sources/ComposeUI/Views/Attachments/AttachmentCollectionViewCell.swift @@ -41,17 +41,19 @@ private struct AttachmentOptionsMenu: View { @Binding var recognizingText: Bool var body: some View { - Menu { - if attachment.drawingData != nil { - EditDrawingButton(attachment: attachment) - } else if attachment.type == .image { - RecognizeTextButton(attachment: attachment, recognizingText: $recognizingText) + if attachment.drawingData != nil || attachment.type == .image { + Menu { + if attachment.drawingData != nil { + EditDrawingButton(attachment: attachment) + } else if attachment.type == .image { + RecognizeTextButton(attachment: attachment, recognizingText: $recognizingText) + } + } label: { + Label("Options", systemImage: "ellipsis.circle.fill") } - } label: { - Label("Options", systemImage: "ellipsis.circle.fill") + .buttonStyle(AttachmentOverlayButtonStyle()) + .padding([.top, .leading], 2) } - .buttonStyle(AttachmentOverlayButtonStyle()) - .padding([.top, .leading], 2) } }