From f0e278db3b6e9022355ac8a25c301936f15454cf Mon Sep 17 00:00:00 2001 From: Dustin Mierau Date: Thu, 7 Dec 2023 00:14:31 -0800 Subject: Few style changes in chat and files and news. --- Hotline/Views/FilesView.swift | 50 +++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 16 deletions(-) (limited to 'Hotline/Views/FilesView.swift') 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 { -- cgit