diff options
| author | Dustin Mierau <dustin@mierau.me> | 2023-12-07 00:14:31 -0800 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2023-12-07 00:14:31 -0800 |
| commit | f0e278db3b6e9022355ac8a25c301936f15454cf (patch) | |
| tree | 5d5e62efcb4a626edf2c4ad885d069aad5b36c13 /Hotline | |
| parent | 2305aa8eab18ec5e60d940351793642145de5bd5 (diff) | |
Few style changes in chat and files and news.
Diffstat (limited to 'Hotline')
| -rw-r--r-- | Hotline/Views/ChatView.swift | 11 | ||||
| -rw-r--r-- | Hotline/Views/FilesView.swift | 50 | ||||
| -rw-r--r-- | Hotline/Views/NewsView.swift | 15 |
3 files changed, 52 insertions, 24 deletions
diff --git a/Hotline/Views/ChatView.swift b/Hotline/Views/ChatView.swift index 108aea3..2283cdd 100644 --- a/Hotline/Views/ChatView.swift +++ b/Hotline/Views/ChatView.swift @@ -15,7 +15,7 @@ struct ChatView: View { @State private var contentHeight: CGFloat = 0 @Namespace var bottomID - + var body: some View { NavigationStack { VStack(spacing: 0) { @@ -26,6 +26,7 @@ struct ChatView: View { if msg.type == .agreement { VStack(alignment: .leading) { Text(msg.text) + .font(.system(size: 11, weight: .regular, design: .monospaced)) .padding() .opacity(0.75) .background(colorScheme == .dark ? Color(white: 0.1) : Color(white: 0.96)) @@ -36,10 +37,12 @@ struct ChatView: View { else { HStack(alignment: .firstTextBaseline) { if !msg.username.isEmpty { - Text("\(msg.username):").bold() + Text("**\(msg.username):** \(msg.text)") + } + else { + Text(msg.text) + .textSelection(.enabled) } - Text(msg.text) - .textSelection(.enabled) Spacer() } .padding() diff --git a/Hotline/Views/FilesView.swift b/Hotline/Views/FilesView.swift index 3b2b236..1395ca6 100644 --- a/Hotline/Views/FilesView.swift +++ b/Hotline/Views/FilesView.swift @@ -44,28 +44,46 @@ struct FilesView: View { var body: some View { NavigationStack { List(hotline.fileList, id: \.self, children: \.files) { tree in - HStack { if tree.isFolder { - HStack(alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/) { - Image(systemName: "folder.fill") + DisclosureGroup { + HStack { + HStack(alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/) { + Image(systemName: "folder.fill") + } + .frame(minWidth: 25) + Text("File").fontWeight(.medium) + Spacer() + Text("4").foregroundStyle(.secondary) +// HStack(alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/) { +// } +// .frame(minWidth: 25) +// ProgressView(value: 0.8) + } + } label: { + HStack { + HStack(alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/) { + Image(systemName: "folder.fill") + } + .frame(minWidth: 25) + Text(tree.name).fontWeight(.medium) + Spacer() + Text("\(tree.fileSize)").foregroundStyle(.secondary) + } } - .frame(minWidth: 25) - Text(tree.name).bold() - Spacer() - Text("\(tree.fileSize)").foregroundStyle(.gray) } else { - HStack(alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/) { - Image(uiImage: fileIcon(name: tree.name)) - .renderingMode(.template) - .foregroundColor(.accentColor) + HStack { + HStack(alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/) { + Image(uiImage: fileIcon(name: tree.name)) + .renderingMode(.template) + .foregroundColor(.accentColor) + } + .frame(minWidth: 25) + Text(tree.name) + Spacer() + Text(formattedFileSize(tree.fileSize)).foregroundStyle(.gray) } - .frame(minWidth: 25) - Text(tree.name).bold() - Spacer() - Text(formattedFileSize(tree.fileSize)).foregroundStyle(.gray) } - } } .listStyle(.plain) .task { diff --git a/Hotline/Views/NewsView.swift b/Hotline/Views/NewsView.swift index 9c4d34a..78282d6 100644 --- a/Hotline/Views/NewsView.swift +++ b/Hotline/Views/NewsView.swift @@ -3,6 +3,7 @@ import SwiftUI struct NewsView: View { @Environment(HotlineState.self) private var appState @Environment(HotlineClient.self) private var hotline + @Environment(\.colorScheme) var colorScheme @State private var fetched = false @State private var selectedCategory: HotlineNewsCategory? = nil @@ -43,6 +44,7 @@ struct NewsView: View { } .padding() } + .background(colorScheme == .dark ? Color(white: 0.1) : Color(uiColor: UIColor.systemBackground)) } var body: some View { @@ -54,14 +56,19 @@ struct NewsView: View { Divider() Spacer() HStack(alignment: .center) { - Image(systemName: "line.3.horizontal") - .opacity(0.2) - .font(.system(size: 14)) + Rectangle() + .fill(.tertiary) + .frame(width: 50, height: 6, alignment: .center) + .cornerRadius(10) +// .opacity(0.3) +// Image(systemName: "line.3.horizontal") +// .opacity(0.2) +// .font(.system(size: 14)) } Spacer() // Divider() } - .background(Color(uiColor: UIColor.systemBackground)) + .background(colorScheme == .dark ? Color(white: 0.1) : Color(uiColor: UIColor.systemBackground)) .frame(maxWidth: .infinity) .frame(height: dividerHeight) .gesture( |