aboutsummaryrefslogtreecommitdiff
path: root/Hotline/macOS/FilesView.swift
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2023-12-20 15:33:33 -0800
committerDustin Mierau <dustin@mierau.me>2023-12-20 15:33:33 -0800
commit5658209bd322449f4b54fa4a3047a485cc2ed32c (patch)
tree1eb82432ffb95873f1ff1b275e8eabfb74f1e14c /Hotline/macOS/FilesView.swift
parentcc19df82bab213bd628792e0b3eca8c2ee986506 (diff)
Add refresh button to Servers window. Fix styling on disclosure arrow. Remove icons from news list. Trying tooltips on some buttons.
Diffstat (limited to 'Hotline/macOS/FilesView.swift')
-rw-r--r--Hotline/macOS/FilesView.swift47
1 files changed, 37 insertions, 10 deletions
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")
+ }
+ }
}
}
}