diff --git a/Tusker/Screens/Compose/ComposeAttachmentsList.swift b/Tusker/Screens/Compose/ComposeAttachmentsList.swift index baad38c735..7c79f2fc66 100644 --- a/Tusker/Screens/Compose/ComposeAttachmentsList.swift +++ b/Tusker/Screens/Compose/ComposeAttachmentsList.swift @@ -44,45 +44,50 @@ struct ComposeAttachmentsList: View { } Button(action: self.addAttachment) { - HStack { - addButtonImage - Text("Add image or video") - } - } - .foregroundColor(.blue) - .disabled(!canAddAttachment) - .frame(height: cellHeight) - .popover(isPresented: $isShowingAssetPickerPopover, content: self.assetPickerPopover) - .contextMenu { - Button(action: self.createDrawing) { - if #available(iOS 14.0, *) { - Label("Draw Something", systemImage: "hand.draw") - } else { - HStack { - Text("Draw Something") - Image(systemName: "hand.draw") - } + if #available(iOS 14.0, *) { + Label("Add photo or video", systemImage: addButtonImageName) + } else { + HStack { + Image(systemName: addButtonImageName) + Text("Add photo or video") } } - .disabled(!canAddAttachment) } + .disabled(!canAddAttachment) + .foregroundColor(.blue) + .frame(height: cellHeight / 2) + .popover(isPresented: $isShowingAssetPickerPopover, content: self.assetPickerPopover) + .listRowInsets(EdgeInsets(top: cellPadding / 2, leading: cellPadding / 2, bottom: cellPadding / 2, trailing: cellPadding / 2)) + + Button(action: self.createDrawing) { + if #available(iOS 14.0, *) { + Label("Draw something", systemImage: "hand.draw") + } else { + HStack(alignment: .lastTextBaseline) { + Image(systemName: "hand.draw") + Text("Draw something") + } + } + } + .disabled(!canAddAttachment) + .foregroundColor(.blue) + .frame(height: cellHeight / 2) + .listRowInsets(EdgeInsets(top: cellPadding / 2, leading: cellPadding / 2, bottom: cellPadding / 2, trailing: cellPadding / 2)) } .frame(height: totalListHeight) .onAppear(perform: self.didAppear) .onReceive(draft.$attachments, perform: self.attachmentsChanged) } - private var addButtonImage: Image { - let name: String + private var addButtonImageName: String { switch colorScheme { case .dark: - name = "photo.fill" + return "photo.fill" case .light: - name = "photo" + return "photo" @unknown default: - name = "photo" + return "photo" } - return Image(systemName: name) } private var canAddAttachment: Bool { @@ -98,7 +103,7 @@ struct ComposeAttachmentsList: View { private var totalListHeight: CGFloat { let totalRowHeights = rowHeights.values.reduce(0, +) let totalPadding = CGFloat(draft.attachments.count) * cellPadding - let addButtonHeight = cellHeight + cellPadding + let addButtonHeight = cellHeight + cellPadding * 2 return totalRowHeights + totalPadding + addButtonHeight }