diff --git a/Session/Conversations/Message Cells/Content Views/SwiftUI/DocumentView_SwiftUI.swift b/Session/Conversations/Message Cells/Content Views/SwiftUI/DocumentView_SwiftUI.swift index 5192a8b61..1d86b1e3e 100644 --- a/Session/Conversations/Message Cells/Content Views/SwiftUI/DocumentView_SwiftUI.swift +++ b/Session/Conversations/Message Cells/Content Views/SwiftUI/DocumentView_SwiftUI.swift @@ -21,9 +21,6 @@ struct DocumentView_SwiftUI: View { spacing: 0 ) { ZStack { - Rectangle() - .foregroundColor(themeColor: .messageBubble_overlay) - Image(systemName: "doc") .font(.system(size: Values.largeFontSize)) .foregroundColor(themeColor: textColor) @@ -45,6 +42,7 @@ struct DocumentView_SwiftUI: View { width: 24 + Values.mediumSpacing * 2, height: 32 + Values.smallSpacing * 2 ) + .background(themeColor: .messageBubble_overlay) VStack( alignment: .leading diff --git a/Session/Conversations/Message Cells/Content Views/SwiftUI/LinkPreviewView_SwiftUI.swift b/Session/Conversations/Message Cells/Content Views/SwiftUI/LinkPreviewView_SwiftUI.swift index 99a3a09ee..db1019ef1 100644 --- a/Session/Conversations/Message Cells/Content Views/SwiftUI/LinkPreviewView_SwiftUI.swift +++ b/Session/Conversations/Message Cells/Content Views/SwiftUI/LinkPreviewView_SwiftUI.swift @@ -70,25 +70,18 @@ public struct LinkPreviewView_SwiftUI: View { state is LinkPreview.DraftState || state is LinkPreview.SentState, let defaultImage: UIImage = UIImage(named: "Link")?.withRenderingMode(.alwaysTemplate) { - ZStack { - if #available(iOS 14.0, *) { - ThemeManager.currentTheme.colorSwiftUI(for: .messageBubble_overlay).ignoresSafeArea() - } else { - ThemeManager.currentTheme.colorSwiftUI(for: .messageBubble_overlay) - } - - Image(uiImage: defaultImage) - .foregroundColor( - themeColor: isOutgoing ? - .messageBubble_outgoingText : - .messageBubble_incomingText - ) - .cornerRadius(state is LinkPreview.SentState ? 0 : 8) - } - .frame( - width: imageSize, - height: imageSize - ) + Image(uiImage: defaultImage) + .foregroundColor( + themeColor: isOutgoing ? + .messageBubble_outgoingText : + .messageBubble_incomingText + ) + .frame( + width: imageSize, + height: imageSize + ) + .background(themeColor: .messageBubble_overlay) + .cornerRadius(state is LinkPreview.SentState ? 0 : 8) } else { ActivityIndicator(themeColor: .borderSeparator, width: 2) .frame( diff --git a/Session/Conversations/Message Cells/Content Views/SwiftUI/QuoteView_SwiftUI.swift b/Session/Conversations/Message Cells/Content Views/SwiftUI/QuoteView_SwiftUI.swift index 31ea42a54..d99cde22b 100644 --- a/Session/Conversations/Message Cells/Content Views/SwiftUI/QuoteView_SwiftUI.swift +++ b/Session/Conversations/Message Cells/Content Views/SwiftUI/QuoteView_SwiftUI.swift @@ -96,16 +96,17 @@ struct QuoteView_SwiftUI: View { } let fallbackImageName: String = (MIMETypeUtil.isAudio(attachment.contentType) ? "attachment_audio" : "actionsheet_document_black") - return UIImage(named: fallbackImageName)?.withRenderingMode(.alwaysTemplate) + return UIImage(named: fallbackImageName)? + .resizedImage(to: CGSize(width: Self.iconSize, height: Self.iconSize))? + .withRenderingMode(.alwaysTemplate) }() { Image(uiImage: image) - .resizable() .foregroundColor(themeColor: { switch info.mode { - case .regular: return (info.direction == .outgoing ? - .messageBubble_outgoingText : - .messageBubble_incomingText - ) + case .regular: return (info.direction == .outgoing ? + .messageBubble_outgoingText : + .messageBubble_incomingText + ) case .draft: return .textPrimary } }()) @@ -114,6 +115,7 @@ struct QuoteView_SwiftUI: View { height: Self.thumbnailSize, alignment: .center ) + .background(themeColor: .messageBubble_overlay) .cornerRadius(Self.cornerRadius) } } else { diff --git a/Session/Conversations/Message Cells/Content Views/SwiftUI/VoiceMessageView_SwiftUI.swift b/Session/Conversations/Message Cells/Content Views/SwiftUI/VoiceMessageView_SwiftUI.swift index 2d1d470f1..3586d6151 100644 --- a/Session/Conversations/Message Cells/Content Views/SwiftUI/VoiceMessageView_SwiftUI.swift +++ b/Session/Conversations/Message Cells/Content Views/SwiftUI/VoiceMessageView_SwiftUI.swift @@ -47,11 +47,13 @@ struct VoiceMessageView_SwiftUI: View { ) } -// ActivityIndicator(themeColor: .textPrimary, width: 2) -// .frame( -// width: Self.toggleContainerSize, -// height: Self.toggleContainerSize -// ) + if attachment.state == .downloading { + ActivityIndicator(themeColor: .textPrimary, width: 2) + .frame( + width: Self.toggleContainerSize, + height: Self.toggleContainerSize + ) + } } Rectangle() diff --git a/Session/Media Viewing & Editing/MessageInfoView.swift b/Session/Media Viewing & Editing/MessageInfoView.swift index 4ab49020a..b9e79080c 100644 --- a/Session/Media Viewing & Editing/MessageInfoView.swift +++ b/Session/Media Viewing & Editing/MessageInfoView.swift @@ -137,9 +137,6 @@ struct MessageInfoView: View { // Attachment Info ZStack { - RoundedRectangle(cornerRadius: Self.cornerRadius) - .fill(themeColor: .backgroundSecondary) - VStack( alignment: .leading, spacing: Values.mediumSpacing @@ -205,6 +202,8 @@ struct MessageInfoView: View { .padding(.all, Values.largeSpacing) } .frame(maxHeight: .infinity) + .background(themeColor: .backgroundSecondary) + .cornerRadius(Self.cornerRadius) .fixedSize(horizontal: false, vertical: true) .padding(.vertical, Values.verySmallSpacing) .padding(.horizontal, Values.largeSpacing) @@ -212,9 +211,6 @@ struct MessageInfoView: View { // Message Info ZStack { - RoundedRectangle(cornerRadius: Self.cornerRadius) - .fill(themeColor: .backgroundSecondary) - VStack( alignment: .leading, spacing: Values.mediumSpacing @@ -293,6 +289,8 @@ struct MessageInfoView: View { .padding(.all, Values.largeSpacing) } .frame(maxHeight: .infinity) + .background(themeColor: .backgroundSecondary) + .cornerRadius(Self.cornerRadius) .fixedSize(horizontal: false, vertical: true) .padding(.vertical, Values.verySmallSpacing) .padding(.horizontal, Values.largeSpacing) @@ -300,9 +298,6 @@ struct MessageInfoView: View { // Actions if !actions.isEmpty { ZStack { - RoundedRectangle(cornerRadius: Self.cornerRadius) - .fill(themeColor: .backgroundSecondary) - VStack( alignment: .leading, spacing: 0 @@ -348,6 +343,8 @@ struct MessageInfoView: View { .padding(.horizontal, Values.largeSpacing) } .frame(maxHeight: .infinity) + .background(themeColor: .backgroundSecondary) + .cornerRadius(Self.cornerRadius) .fixedSize(horizontal: false, vertical: true) .padding(.vertical, Values.verySmallSpacing) .padding(.horizontal, Values.largeSpacing) diff --git a/SessionUIKit/Style Guide/Themes/SwiftUI+Theme.swift b/SessionUIKit/Style Guide/Themes/SwiftUI+Theme.swift index a087cba11..2915ec462 100644 --- a/SessionUIKit/Style Guide/Themes/SwiftUI+Theme.swift +++ b/SessionUIKit/Style Guide/Themes/SwiftUI+Theme.swift @@ -8,6 +8,12 @@ public extension View { ThemeManager.currentTheme.colorSwiftUI(for: themeColor) ) } + + func background(themeColor: ThemeValue) -> some View { + return self.background( + ThemeManager.currentTheme.colorSwiftUI(for: themeColor) + ) + } } public extension Shape {