diff options
Diffstat (limited to 'Hotline/macOS')
| -rw-r--r-- | Hotline/macOS/ChatView.swift | 35 | ||||
| -rw-r--r-- | Hotline/macOS/MessageBoardView.swift | 11 |
2 files changed, 20 insertions, 26 deletions
diff --git a/Hotline/macOS/ChatView.swift b/Hotline/macOS/ChatView.swift index 1b82e02..57814e2 100644 --- a/Hotline/macOS/ChatView.swift +++ b/Hotline/macOS/ChatView.swift @@ -37,16 +37,8 @@ struct ChatView: View { // MARK: Agreement if msg.type == .agreement { VStack(alignment: .center, spacing: 16) { - #if os(iOS) if let bannerImage = self.model.bannerImage { -// #if os(macOS) -// Image(nsImage: bannerImage) -// .resizable() -// .scaledToFit() -// .frame(maxWidth: 468.0) -// .clipShape(RoundedRectangle(cornerRadius: 3)) -// #elseif os(iOS) Image(uiImage: bannerImage) .resizable() .scaledToFit() @@ -54,24 +46,31 @@ struct ChatView: View { .clipShape(RoundedRectangle(cornerRadius: 3)) } #endif - - VStack(spacing: 0) { + HStack(spacing: 0) { + Spacer() + ScrollView(.vertical) { HStack { - Text(msg.text) + Text(LocalizedStringKey(msg.text.convertLinksToMarkdown())) .font(.system(size: 12)) .fontDesign(.monospaced) .textSelection(.enabled) + .tint(Color("Link Color")) Spacer() } .padding(16) } .scrollBounceBehavior(.basedOnSize) - .frame(maxHeight: 375) + .frame(maxWidth: 468, maxHeight: 375) + + Spacer() } - .background(Color(white: colorScheme == .light ? 0.0 : 1.0).opacity(0.05)) - .frame(maxWidth: 468.0) - .clipShape(RoundedRectangle(cornerRadius: 3)) + #if os(iOS) + .background(Color("Agreement Background")) + #elseif os(macOS) + .background(VisualEffectView(material: .titlebar, blendingMode: .withinWindow)) + #endif + .clipShape(RoundedRectangle(cornerRadius: 8)) } .frame(maxWidth: .infinity) .padding() @@ -92,16 +91,18 @@ struct ChatView: View { else { HStack(alignment: .firstTextBaseline) { if let username = msg.username { - Text("**\(username):** \(msg.text)") + Text(LocalizedStringKey("**\(username):** \(msg.text)".convertLinksToMarkdown())) .lineSpacing(4) .multilineTextAlignment(.leading) .textSelection(.enabled) + .tint(Color("Link Color")) } else { - Text(msg.text) + Text(LocalizedStringKey(msg.text.convertLinksToMarkdown())) .lineSpacing(4) .multilineTextAlignment(.leading) .textSelection(.enabled) + .tint(Color("Link Color")) } Spacer() } diff --git a/Hotline/macOS/MessageBoardView.swift b/Hotline/macOS/MessageBoardView.swift index 27b4be7..660ca05 100644 --- a/Hotline/macOS/MessageBoardView.swift +++ b/Hotline/macOS/MessageBoardView.swift @@ -13,7 +13,8 @@ struct MessageBoardView: View { ScrollView { LazyVStack(alignment: .leading) { ForEach(model.messageBoard, id: \.self) { - Text($0) + Text(LocalizedStringKey($0.convertLinksToMarkdown())) + .tint(Color("Link Color")) .lineLimit(100) .lineSpacing(4) .padding() @@ -51,9 +52,6 @@ struct MessageBoardView: View { } .padding() } - - - } .sheet(isPresented: $composerDisplayed) { TextEditor(text: $composerText) @@ -82,11 +80,6 @@ struct MessageBoardView: View { } } } -// .alert("Hello", isPresented: $showPermissionAlert) { -// Button("OK") { -// showPermissionAlert.toggle() -// } -// } message: { Text("WHAT") } .toolbar { ToolbarItem(placement:.primaryAction) { Button { |