summaryrefslogtreecommitdiff
path: root/Hutch/Views/Pastes
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-13 19:06:54 -0500
committerChristian Cleberg <[email protected]>2026-04-13 19:06:54 -0500
commita6ad2b9815d72575206bdca860eef9db850cdf1c (patch)
treeb4d5f27aa1655e5e40bab178550d6e2576d7df8b /Hutch/Views/Pastes
parent02a44d115b3784231cad640e992d9c18a7f67b40 (diff)
downloadhutch-a6ad2b9815d72575206bdca860eef9db850cdf1c.tar.gz
hutch-a6ad2b9815d72575206bdca860eef9db850cdf1c.tar.bz2
hutch-a6ad2b9815d72575206bdca860eef9db850cdf1c.zip
feat(theme): AMOLED true-black rows via themedRow()
Apply listRowBackground(Color.black) per row in AMOLED mode using ThemedRowStyle and themedRow() across Lists and Forms. Use themedList() for scroll/grouped backgrounds. Treat segmented and clear list rows with isAMOLED-aware listRowBackground where Color.clear was required. Removes reliance on UIKit appearance for list cells on iOS 16+. Implements: https://todo.sr.ht/~ccleberg/hutch/24
Diffstat (limited to 'Hutch/Views/Pastes')
-rw-r--r--Hutch/Views/Pastes/PasteDetailView.swift8
-rw-r--r--Hutch/Views/Pastes/PasteListView.swift8
2 files changed, 16 insertions, 0 deletions
diff --git a/Hutch/Views/Pastes/PasteDetailView.swift b/Hutch/Views/Pastes/PasteDetailView.swift
index 7eb1853..c6fe11a 100644
--- a/Hutch/Views/Pastes/PasteDetailView.swift
+++ b/Hutch/Views/Pastes/PasteDetailView.swift
@@ -326,13 +326,18 @@ private struct PasteInfoSheet: View {
List {
Section("Paste") {
LabeledContent("ID", value: paste.id)
+ .themedRow()
LabeledContent("Owner", value: paste.user.canonicalName)
+ .themedRow()
LabeledContent("Created", value: paste.created.relativeDescription)
+ .themedRow()
LabeledContent("Visibility") {
VisibilityBadge(visibility: paste.visibility)
}
+ .themedRow()
if paste.files.count > 1 {
LabeledContent("Files", value: "\(paste.files.count)")
+ .themedRow()
}
}
@@ -340,6 +345,7 @@ private struct PasteInfoSheet: View {
Section("File") {
if let filename = file.filename, !filename.isEmpty {
LabeledContent("Filename", value: filename)
+ .themedRow()
}
LabeledContent("Hash") {
Text(file.hash)
@@ -347,6 +353,7 @@ private struct PasteInfoSheet: View {
.foregroundStyle(.secondary)
.textSelection(.enabled)
}
+ .themedRow()
}
}
}
@@ -407,6 +414,7 @@ private struct PasteVisibilitySheet: View {
}
.buttonStyle(.plain)
}
+ .themedRow()
}
.listStyle(.insetGrouped)
.navigationTitle("Visibility")
diff --git a/Hutch/Views/Pastes/PasteListView.swift b/Hutch/Views/Pastes/PasteListView.swift
index 9363b08..dfd472b 100644
--- a/Hutch/Views/Pastes/PasteListView.swift
+++ b/Hutch/Views/Pastes/PasteListView.swift
@@ -101,6 +101,7 @@ struct PasteListView: View {
await viewModel.loadMoreIfNeeded(currentItem: paste)
}
}
+ .themedRow()
if viewModel.isLoadingMore {
HStack {
@@ -109,6 +110,7 @@ struct PasteListView: View {
Spacer()
}
.listRowSeparator(.hidden)
+ .themedRow()
}
}
.themedList()
@@ -302,12 +304,14 @@ private struct CreatePasteSheet: View {
files = [PasteUploadDraft()]
}
}
+ .themedRow()
Button {
files.append(PasteUploadDraft())
} label: {
Label("Add File", systemImage: "plus")
}
+ .themedRow()
}
Section("Visibility") {
@@ -316,21 +320,25 @@ private struct CreatePasteSheet: View {
Text("Unlisted").tag(Visibility.unlisted)
Text("Private").tag(Visibility.private)
}
+ .themedRow()
}
Section {
Text("Paste contents are uploaded as UTF-8 text files. Hutch can change visibility later, but the API does not support editing file contents after creation.")
.font(.footnote)
.foregroundStyle(.secondary)
+ .themedRow()
}
if let error = viewModel.error {
Section {
Label(error, systemImage: "exclamationmark.triangle.fill")
.foregroundStyle(.red)
+ .themedRow()
}
}
}
+ .themedList()
.navigationTitle("New Paste")
.navigationBarTitleDisplayMode(.inline)
.toolbar {