diff options
Diffstat (limited to 'Sora/Views')
7 files changed, 78 insertions, 68 deletions
diff --git a/Sora/Views/Settings/Section/SettingsSectionContentRatingsView.swift b/Sora/Views/Settings/Section/SettingsSectionContentRatingsView.swift index 85b28af..40a8a7e 100644 --- a/Sora/Views/Settings/Section/SettingsSectionContentRatingsView.swift +++ b/Sora/Views/Settings/Section/SettingsSectionContentRatingsView.swift @@ -5,7 +5,7 @@ struct SettingsSectionContentRatingsView: View { var body: some View { List { - Section(header: Text("Display Content Ratings")) { + Section("Show Ratings") { ForEach(BooruRating.allCases, id: \.self) { rating in Toggle( rating.rawValue, @@ -25,7 +25,7 @@ struct SettingsSectionContentRatingsView: View { } } - Section(header: Text("Blur Content Ratings")) { + Section("Blur Ratings") { ForEach(BooruRating.allCases, id: \.self) { rating in Toggle( rating.rawValue, @@ -43,7 +43,7 @@ struct SettingsSectionContentRatingsView: View { } } } - .navigationTitle(Text("Content Filtering")) + .navigationTitle(Text("Sensitive Content")) #if !os(macOS) .navigationBarTitleDisplayMode(.inline) #endif diff --git a/Sora/Views/Settings/Section/SettingsSectionDetailsView.swift b/Sora/Views/Settings/Section/SettingsSectionDetailsView.swift index 9634297..8db6002 100644 --- a/Sora/Views/Settings/Section/SettingsSectionDetailsView.swift +++ b/Sora/Views/Settings/Section/SettingsSectionDetailsView.swift @@ -5,7 +5,7 @@ struct SettingsSectionDetailsView: View { var body: some View { Form { - Section(header: Text("Image Quality")) { + Section("Image Quality") { Picker("Image Quality", selection: $settings.detailViewQuality) { ForEach(BooruPostFileType.allCases, id: \.self) { type in Text(type.rawValue.capitalized).tag(type) @@ -13,32 +13,32 @@ struct SettingsSectionDetailsView: View { } } - Section(header: Text("Display Options")) { - Toggle("Enable \"Share Image\" Shortcut", isOn: $settings.enableShareShortcut) + Section("Appearance") { + Toggle("Show Share Action", isOn: $settings.enableShareShortcut) - Toggle("Display Information Bar", isOn: $settings.displayDetailsInformationBar) + Toggle("Show Information Bar", isOn: $settings.displayDetailsInformationBar) } #if os(macOS) - Section(header: Text("File Management")) { + Section("Saved Files") { Toggle(isOn: $settings.saveTagsToFile) { - Text("Save Tags to File") + Text("Save Tags Alongside Images") Text("Saves post tags in a file alongside the downloaded image.") } } #endif - Section(header: Text("Performance")) { + Section("Loading") { let preloadRange = 0...10 #if os(macOS) - Picker("Preloaded Images", selection: $settings.preloadedCarouselImages) { + Picker("Preload Nearby Images", selection: $settings.preloadedCarouselImages) { ForEach(preloadRange, id: \.self) { columns in Text("\(columns)") } } #else Stepper( - "Preloaded Images: \(settings.preloadedCarouselImages)", + "Preload Nearby Images: \(settings.preloadedCarouselImages)", value: $settings.preloadedCarouselImages, in: preloadRange ) @@ -48,7 +48,7 @@ struct SettingsSectionDetailsView: View { #if os(macOS) .formStyle(.grouped) #endif - .navigationTitle("Details") + .navigationTitle("Viewer") #if !os(macOS) .navigationBarTitleDisplayMode(.large) #endif diff --git a/Sora/Views/Settings/Section/SettingsSectionProviderView.swift b/Sora/Views/Settings/Section/SettingsSectionProviderView.swift index 031840a..b9a7900 100644 --- a/Sora/Views/Settings/Section/SettingsSectionProviderView.swift +++ b/Sora/Views/Settings/Section/SettingsSectionProviderView.swift @@ -9,8 +9,8 @@ struct SettingsSectionProviderView: View { var body: some View { Form { - Section(header: Text("Provider Selection")) { - Picker("Provider", selection: $settings.preferredBooru) { + Section("Source") { + Picker("Website", selection: $settings.preferredBooru) { ForEach(BooruProvider.allCases, id: \.self) { type in Text(type.rawValue).tag(type) } @@ -22,24 +22,13 @@ struct SettingsSectionProviderView: View { } } - Section(header: Text("Moebooru Feed")) { - Toggle("Show Held Posts", isOn: $settings.showHeldMoebooruPosts) - } - - Section(header: Text("User-Agent")) { - Toggle("Send User-Agent", isOn: $settings.sendBooruUserAgent) - - if settings.sendBooruUserAgent { - TextField("Custom User-Agent", text: $settings.customBooruUserAgent) - .autocorrectionDisabled(true) - - Text("Leave this field empty to use Sora's default User-Agent.") - .font(.caption) - .foregroundStyle(.secondary) + if BooruProviderFlavor(provider: settings.preferredBooru) == .moebooru { + Section("Hidden Posts") { + Toggle("Show Hidden Posts", isOn: $settings.showHeldMoebooruPosts) } } - Section(header: Text("API Credentials")) { + Section { SecureField( "API Key", text: Binding( @@ -78,23 +67,40 @@ struct SettingsSectionProviderView: View { #if os(iOS) .keyboardType(isDanbooruProvider ? .default : .numberPad) #endif + } header: { + Text("Account") + } footer: { + Text("Add credentials only if your selected source supports them.") + } + + Section { + Toggle("Send User Agent", isOn: $settings.sendBooruUserAgent) + + if settings.sendBooruUserAgent { + TextField("Custom User Agent", text: $settings.customBooruUserAgent) + .autocorrectionDisabled(true) + } + } header: { + Text("Advanced") + } footer: { + Text("Only change these options if a source requires them.") } - Section(header: Text("Custom Providers")) { - Button("Add Custom Provider") { + Section { + Button("Add Source") { showingCustomBooruSheet = true } .trailingFrame() if case .custom(let provider) = settings.preferredBooru { - Button("Remove Custom Provider") { + Button("Remove Current Source") { settings.customProviders.removeAll { $0.id == provider.id } settings.preferredBooru = .safebooru } .disabled(!settings.customProviders.contains { $0.id == provider.id }) } - Button("Remove All Custom Providers") { + Button("Remove All Custom Sources") { if case .custom = settings.preferredBooru { settings.preferredBooru = .safebooru } @@ -104,23 +110,27 @@ struct SettingsSectionProviderView: View { } } .trailingFrame() + } header: { + Text("Custom Sources") + } footer: { + Text("Use custom sources when you want Sora to browse a compatible site.") } } #if os(macOS) .formStyle(.grouped) #endif - .navigationTitle("Provider") + .navigationTitle("Source") #if !os(macOS) .navigationBarTitleDisplayMode(.large) #endif .sheet(isPresented: $showingCustomBooruSheet) { NavigationStack { Form { - Section(header: Text("Provider Details")) { - TextField("Domain", text: $newDomain) + Section("Source Details") { + TextField("Website", text: $newDomain) .autocorrectionDisabled(true) - Picker("Provider Type", selection: $newFlavor) { + Picker("Type", selection: $newFlavor) { ForEach(BooruProviderFlavor.allCases, id: \.self) { flavor in Text(flavor.rawValue).tag(flavor) } @@ -130,7 +140,7 @@ struct SettingsSectionProviderView: View { #if os(macOS) .formStyle(.grouped) #endif - .navigationTitle("Add Custom Provider") + .navigationTitle("Add Source") #if !os(macOS) .navigationBarTitleDisplayMode(.inline) #endif @@ -155,7 +165,7 @@ struct SettingsSectionProviderView: View { } } .alert( - "Invalid Domain", + "Invalid Website", isPresented: Binding( get: { domainError != nil }, set: { if !$0 { domainError = nil } } @@ -196,19 +206,19 @@ struct SettingsSectionProviderView: View { "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*\\.[a-z]{2,}$" guard NSPredicate(format: "SELF MATCHES %@", domainRegex).evaluate(with: domain) else { - domainError = "Please enter a valid domain name, such as yande.re." + domainError = "Enter a valid website, such as yande.re." return false } guard !domain.contains("://"), !domain.contains("/"), !domain.contains("?") else { - domainError = "Only enter the domain name—leave out 'http://' or extra details." + domainError = "Enter only the website name, without 'http://' or extra details." return false } guard domain.count <= 253 else { // RFC 1035 - domainError = "This domain name is too long. It must be 253 characters or fewer." + domainError = "This website name is too long. It must be 253 characters or fewer." return false } @@ -216,7 +226,7 @@ struct SettingsSectionProviderView: View { let labels = domain.split(separator: ".") guard labels.allSatisfy({ $0.count <= 63 }) else { - domainError = "Each section of the domain name must be 63 characters or fewer." + domainError = "Each section of the website name must be 63 characters or fewer." return false } diff --git a/Sora/Views/Settings/Section/SettingsSectionSearchView.swift b/Sora/Views/Settings/Section/SettingsSectionSearchView.swift index 6249c4a..b702cd4 100644 --- a/Sora/Views/Settings/Section/SettingsSectionSearchView.swift +++ b/Sora/Views/Settings/Section/SettingsSectionSearchView.swift @@ -4,13 +4,13 @@ struct SettingsSectionSearchView: View { @EnvironmentObject var settings: SettingsManager var body: some View { - Picker("Suggestion Mode", selection: $settings.searchSuggestionsMode) { + Picker("Suggestions", selection: $settings.searchSuggestionsMode) { ForEach(SettingsSearchSuggestionsMode.allCases, id: \.self) { type in Text(type.rawValue.capitalized).tag(type) } } - Button("Clear History") { + Button("Clear Search History") { settings.searchHistory.removeAll() } .trailingFrame() diff --git a/Sora/Views/Settings/Section/SettingsSectionSettingsView.swift b/Sora/Views/Settings/Section/SettingsSectionSettingsView.swift index 273cc82..784ee2a 100644 --- a/Sora/Views/Settings/Section/SettingsSectionSettingsView.swift +++ b/Sora/Views/Settings/Section/SettingsSectionSettingsView.swift @@ -7,14 +7,14 @@ struct SettingsSectionSettingsView: View { Toggle(isOn: $settings.enableSync) { Text("Sync with iCloud") - Text("Keep bookmarks, search history, and providers consistent across all your devices.") + Text("Keep bookmarks, collections, search history, and sources in sync across your devices.") .font(.caption) } .onChange(of: settings.enableSync) { _, _ in settings.triggerSyncIfNeededForAll() } - Button("Reset to Defaults") { + Button("Reset Settings") { settings.resetToDefaults() } .trailingFrame() diff --git a/Sora/Views/Settings/Section/SettingsSectionThumbnailsView.swift b/Sora/Views/Settings/Section/SettingsSectionThumbnailsView.swift index ddfbdcc..f8dffc8 100644 --- a/Sora/Views/Settings/Section/SettingsSectionThumbnailsView.swift +++ b/Sora/Views/Settings/Section/SettingsSectionThumbnailsView.swift @@ -6,7 +6,7 @@ struct SettingsSectionThumbnailsView: View { var body: some View { Form { - Section(header: Text("Thumbnail Quality")) { + Section("Image Quality") { Picker("Thumbnail Quality", selection: $settings.thumbnailQuality) { ForEach(BooruPostFileType.allCases, id: \.self) { type in Text(type.rawValue.capitalized).tag(type) @@ -14,27 +14,27 @@ struct SettingsSectionThumbnailsView: View { } } - Section(header: Text("Grid Layout")) { + Section("Layout") { #if os(macOS) - Picker("Thumbnail Grid Columns", selection: $settings.thumbnailGridColumns) { + Picker("Columns", selection: $settings.thumbnailGridColumns) { ForEach(1...10, id: \.self) { columns in Text("\(columns)") } } #else Stepper( - "Thumbnail Grid Columns: \(settings.thumbnailGridColumns)", + "Columns: \(settings.thumbnailGridColumns)", value: $settings.thumbnailGridColumns, in: 1...10 ) #endif - Toggle("Uniform Thumbnail Size", isOn: $settings.uniformThumbnailGrid) + Toggle("Square Thumbnails", isOn: $settings.uniformThumbnailGrid) - Toggle("Lazy Thumbnail Loading", isOn: $settings.alternativeThumbnailGrid) + Toggle("Prioritize Scrolling Performance", isOn: $settings.alternativeThumbnailGrid) } - Section(header: Text("Content Filtering")) { + Section("Sensitive Content") { #if os(macOS) - Button("Content Filtering") { + Button("Sensitive Content") { isShowingContentFiltering.toggle() } .sheet(isPresented: $isShowingContentFiltering) { @@ -44,7 +44,7 @@ struct SettingsSectionThumbnailsView: View { .trailingFrame() #else NavigationLink(destination: SettingsSectionContentRatingsView()) { - Text("Content Filtering") + Text("Sensitive Content") } #endif } diff --git a/Sora/Views/Settings/SettingsView.swift b/Sora/Views/Settings/SettingsView.swift index 814a303..4ea60b8 100644 --- a/Sora/Views/Settings/SettingsView.swift +++ b/Sora/Views/Settings/SettingsView.swift @@ -4,45 +4,45 @@ struct SettingsView: View { var body: some View { NavigationStack { Form { - Section(header: Text("Appearance and Behavior")) { + Section("Browsing") { NavigationLink(destination: SettingsSectionProviderView()) { - Text("Provider Settings") + Text("Source") } NavigationLink(destination: SettingsSectionThumbnailsView()) { - Text("Thumbnail Settings") + Text("Thumbnails") } NavigationLink(destination: SettingsSectionDetailsView()) { - Text("Details Settings") + Text("Viewer") } } - Section(header: Text("Search")) { + Section("Search") { SettingsSectionSearchView() } - Section(header: Text("Collections")) { + Section("Library") { NavigationLink(destination: SettingsCollectionsListView()) { - Text("Manage Collections") + Text("Collections") } } - Section(header: Text("Settings")) { + Section("Storage & Sync") { SettingsSectionSettingsView() } - Section(header: Text("Import and Export")) { + Section("Bookmarks") { SettingsSectionImportExportView() } #if DEBUG - Section(header: Text("Debug")) { + Section("Debug") { SettingsSectionDebugView() } #endif - Section(header: Text("Credits")) { + Section("About") { SettingsSectionCreditsView() } } |