From 95250286684852469483afb9fa4378e7a8096fd6 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Fri, 16 Dec 2022 15:35:28 -0800 Subject: [PATCH] dms: make chat area more obvious This was an ios16 bug Changelog-Fixed: Make dm chat area visible again --- damus/Views/DMChatView.swift | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/damus/Views/DMChatView.swift b/damus/Views/DMChatView.swift index 0e13f83e..c7890830 100644 --- a/damus/Views/DMChatView.swift +++ b/damus/Views/DMChatView.swift @@ -12,6 +12,12 @@ struct DMChatView: View { let pubkey: String @EnvironmentObject var dms: DirectMessageModel @State var message: String = "" + + init(damus_state: DamusState, pubkey: String) { + self.damus_state = damus_state + self.pubkey = pubkey + UITextView.appearance().backgroundColor = .clear + } var Messages: some View { ScrollViewReader { scroller in @@ -47,11 +53,9 @@ struct DMChatView: View { var InputField: some View { TextEditor(text: $message) - .textEditorBackground { - InputBackground() - } .cornerRadius(20) - .padding(16) + .padding(8) + .background(InputBackground().cornerRadius(20)) .foregroundColor(Color.primary) } @@ -59,9 +63,9 @@ struct DMChatView: View { func InputBackground() -> Color { if colorScheme == .light { - return Color.init(.sRGB, red: 0.9, green: 0.9, blue: 0.9, opacity: 1.0) + return Color.init(.sRGB, red: 0.8, green: 0.8, blue: 0.8, opacity: 1.0) } else { - return Color.init(.sRGB, red: 0.1, green: 0.1, blue: 0.1, opacity: 1.0) + return Color.init(.sRGB, red: 0.2, green: 0.2, blue: 0.2, opacity: 1.0) } } @@ -74,21 +78,21 @@ struct DMChatView: View { } var Footer: some View { - ZStack { - BackgroundColor() + //ZStack { + //BackgroundColor() - HStack(spacing: 0) { - InputField + HStack(spacing: 0) { + InputField - if !message.isEmpty { - Button(role: .none, action: send_message) { - Label("", systemImage: "arrow.right.circle") - .font(.title) - } + if !message.isEmpty { + Button(role: .none, action: send_message) { + Label("", systemImage: "arrow.right.circle") + .font(.title) } } } .frame(height: 50 + 20 * CGFloat(text_lines)) + //} } var text_lines: Int {