summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-03-05 04:12:02 -0800
committerFuwn <[email protected]>2025-03-05 04:12:02 -0800
commit4f105a43c03e347e9af0dfaae17cf7d910a9d0ab (patch)
tree0c0a42b4b0e8fe2e1349a87a8a205e0f49746d3d
parentfeat: Development commit (diff)
downloadsora-testing-4f105a43c03e347e9af0dfaae17cf7d910a9d0ab.tar.xz
sora-testing-4f105a43c03e347e9af0dfaae17cf7d910a9d0ab.zip
feat: Development commit
-rw-r--r--Sora/Views/Settings/Section/SettingsProviderView.swift57
1 files changed, 32 insertions, 25 deletions
diff --git a/Sora/Views/Settings/Section/SettingsProviderView.swift b/Sora/Views/Settings/Section/SettingsProviderView.swift
index eb3fb1b..79ea146 100644
--- a/Sora/Views/Settings/Section/SettingsProviderView.swift
+++ b/Sora/Views/Settings/Section/SettingsProviderView.swift
@@ -23,39 +23,40 @@ struct SettingsProviderView: View {
Button("Add Custom Provider") {
showingCustomBooruSheet = true
}
+ #if os(macOS)
+ .frame(maxWidth: .infinity, alignment: .trailing)
+ #endif
.sheet(isPresented: $showingCustomBooruSheet) {
- NavigationView {
- Form {
- TextField("Domain", text: $newDomain)
- .autocorrectionDisabled(true)
-
- Picker("Flavor", selection: $newFlavor) {
- ForEach(BooruProviderFlavor.allCases, id: \.self) { flavor in
- Text(flavor.rawValue).tag(flavor)
- }
+ Form {
+ TextField("Domain", text: $newDomain)
+ .autocorrectionDisabled(true)
+
+ Picker("Flavor", selection: $newFlavor) {
+ ForEach(BooruProviderFlavor.allCases, id: \.self) { flavor in
+ Text(flavor.rawValue).tag(flavor)
}
}
- .toolbar {
- ToolbarItem(placement: .cancellationAction) {
- Button("Cancel") {
- showingCustomBooruSheet = false
- resetForm()
- }
+ }
+ #if os(macOS)
+ .formStyle(.grouped)
+ #endif
+ .toolbar {
+ ToolbarItem(placement: .cancellationAction) {
+ Button("Cancel") {
+ showingCustomBooruSheet = false
+ resetForm()
}
+ }
- ToolbarItem(placement: .confirmationAction) {
- Button("Add") {
- if validateDomain() {
- addCustomProvider()
- showingCustomBooruSheet = false
- }
+ ToolbarItem(placement: .confirmationAction) {
+ Button("Add") {
+ if validateDomain() {
+ addCustomProvider()
+ showingCustomBooruSheet = false
}
- .disabled(newDomain.isEmpty || domainError != nil)
}
+ .disabled(newDomain.isEmpty || domainError != nil)
}
- #if os(macOS)
- .navigationTitle("Add Custom Provider")
- #endif
}
}
@@ -72,6 +73,9 @@ struct SettingsProviderView: View {
settings.customProviders.removeAll()
}
}
+ #if os(macOS)
+ .frame(maxWidth: .infinity, alignment: .trailing)
+ #endif
}
.alert(
"Invalid Domain",
@@ -151,5 +155,8 @@ struct SettingsProviderView: View {
settings.preferredBooru = .safebooru
}
.disabled(!settings.customProviders.contains { $0.id == provider.id })
+ #if os(macOS)
+ .frame(maxWidth: .infinity, alignment: .trailing)
+ #endif
}
}