From 978486bc157b21bf0a69a9101f4ed2e063d63ef6 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Fri, 20 Oct 2023 11:23:29 -0400 Subject: [PATCH] visionOS: Improve button appearance in Compose attachment list --- .../Controllers/AttachmentsListController.swift | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentsListController.swift b/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentsListController.swift index 15b9b921..611a2dd3 100644 --- a/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentsListController.swift +++ b/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentsListController.swift @@ -131,9 +131,9 @@ class AttachmentsListController: ViewController { @Environment(\.horizontalSizeClass) private var horizontalSizeClass var body: some View { + attachmentsList + Group { - attachmentsList - if controller.parent.config.presentAssetPicker != nil { addImageButton .listRowInsets(EdgeInsets(top: cellPadding / 2, leading: cellPadding / 2, bottom: cellPadding / 2, trailing: cellPadding / 2)) @@ -147,6 +147,10 @@ class AttachmentsListController: ViewController { togglePollButton .listRowInsets(EdgeInsets(top: cellPadding / 2, leading: cellPadding / 2, bottom: cellPadding / 2, trailing: cellPadding / 2)) } + #if os(visionOS) + .buttonStyle(.bordered) + .labelStyle(AttachmentButtonLabelStyle()) + #endif } private var attachmentsList: some View { @@ -246,3 +250,11 @@ fileprivate struct SheetOrPopover: ViewModifier { } } } + +@available(visionOS 1.0, *) +fileprivate struct AttachmentButtonLabelStyle: LabelStyle { + func makeBody(configuration: Configuration) -> some View { + DefaultLabelStyle().makeBody(configuration: configuration) + .foregroundStyle(.white) + } +}