From 5658209bd322449f4b54fa4a3047a485cc2ed32c Mon Sep 17 00:00:00 2001 From: Dustin Mierau Date: Wed, 20 Dec 2023 15:33:33 -0800 Subject: Add refresh button to Servers window. Fix styling on disclosure arrow. Remove icons from news list. Trying tooltips on some buttons. --- Hotline/macOS/FilesView.swift | 47 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 10 deletions(-) (limited to 'Hotline/macOS/FilesView.swift') diff --git a/Hotline/macOS/FilesView.swift b/Hotline/macOS/FilesView.swift index 8482dd9..19dde94 100644 --- a/Hotline/macOS/FilesView.swift +++ b/Hotline/macOS/FilesView.swift @@ -18,19 +18,20 @@ struct FileView: View { file.expanded.toggle() } } label: { - Image(systemName: file.expanded ? "chevron.down" : "chevron.right") - .renderingMode(.template) - .frame(width: 10, height: 10) - .aspectRatio(contentMode: .fit) + Text(Image(systemName: file.expanded ? "chevron.down" : "chevron.right")) + .bold() + .font(.system(size: 10)) .opacity(0.5) } .buttonStyle(.plain) - .frame(width: 12) + .frame(width: 10) + .padding(.leading, 4) } else { HStack { - }.frame(width: 12) + }.frame(width: 10) + .padding(.leading, 4) } HStack(alignment: .center) { if file.isFolder { @@ -39,17 +40,18 @@ struct FileView: View { else { fileIcon(name: file.name) .resizable() - .scaledToFill() + .aspectRatio(contentMode: .fit) +// .scaledToFill() .frame(width: 16, height: 16) } } .frame(width: 15) Text(file.name).lineLimit(1).truncationMode(.tail) + if file.isFolder && loading { + ProgressView().controlSize(.small).padding([.leading, .trailing], 1) + } Spacer() if file.isFolder { - if loading { - ProgressView().controlSize(.small).padding(.trailing, 4) - } Text("^[\(file.fileSize) file](inflect: true)") .foregroundStyle(.secondary) .lineLimit(1) @@ -154,6 +156,31 @@ struct FilesView: View { .frame(maxWidth: .infinity) } } + .toolbar { + ToolbarItem(placement: .primaryAction) { + Button { + } label: { + Label("Download File", systemImage: "square.and.arrow.down") + } + .help("Download") + } + + ToolbarItem(placement: .primaryAction) { + Button { + } label: { + Label("Preview File", systemImage: "eye") + } + .help("Preview") + } + + ToolbarItem(placement: .primaryAction) { + Button { + } label: { + Label("Delete File", systemImage: "trash") + } + .help("Delete") + } + } } } } -- cgit