Compare commits
No commits in common. "471d3459a6293d241525b53a80d41d9dbce39173" and "20c4c4bb2fcb7b2d37a451b7e588343a57a0bfe2" have entirely different histories.
471d3459a6
...
20c4c4bb2f
|
@ -42,7 +42,6 @@ struct AboutView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
|
|
||||||
Section {
|
Section {
|
||||||
Link("Website", destination: URL(string: "https://vaccor.space/tusker")!)
|
Link("Website", destination: URL(string: "https://vaccor.space/tusker")!)
|
||||||
|
@ -68,10 +67,7 @@ struct AboutView: View {
|
||||||
Link("Source Code", destination: URL(string: "https://git.shadowfacts.net/shadowfacts/Tusker")!)
|
Link("Source Code", destination: URL(string: "https://git.shadowfacts.net/shadowfacts/Tusker")!)
|
||||||
Link("Issue Tracker", destination: URL(string: "https://git.shadowfacts.net/shadowfacts/Tusker/issues")!)
|
Link("Issue Tracker", destination: URL(string: "https://git.shadowfacts.net/shadowfacts/Tusker/issues")!)
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
.listStyle(.insetGrouped)
|
|
||||||
.appGroupedScrollBackgroundIfAvailable()
|
|
||||||
.sheet(isPresented: $isShowingMailSheet) {
|
.sheet(isPresented: $isShowingMailSheet) {
|
||||||
MailSheet(logData: logData)
|
MailSheet(logData: logData)
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ struct AcknowledgementsView: View {
|
||||||
Text(text)
|
Text(text)
|
||||||
.padding(.horizontal, 16)
|
.padding(.horizontal, 16)
|
||||||
}
|
}
|
||||||
.appGroupedScrollBackgroundIfAvailable()
|
|
||||||
.navigationTitle("Acknowledgements")
|
.navigationTitle("Acknowledgements")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,7 @@ struct AdvancedPrefsView : View {
|
||||||
errorReportingSection
|
errorReportingSection
|
||||||
cachingSection
|
cachingSection
|
||||||
}
|
}
|
||||||
.listStyle(.insetGrouped)
|
.listStyle(InsetGroupedListStyle())
|
||||||
.appGroupedScrollBackgroundIfAvailable()
|
|
||||||
.navigationBarTitle(Text("Advanced"))
|
.navigationBarTitle(Text("Advanced"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +50,6 @@ struct AdvancedPrefsView : View {
|
||||||
// see FB6838291
|
// see FB6838291
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var cloudKitSection: some View {
|
var cloudKitSection: some View {
|
||||||
|
@ -76,9 +74,7 @@ struct AdvancedPrefsView : View {
|
||||||
Text(String(describing: cloudKitStatus!))
|
Text(String(describing: cloudKitStatus!))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}.task {
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
.task {
|
|
||||||
CKContainer.default().accountStatus { status, error in
|
CKContainer.default().accountStatus { status, error in
|
||||||
if let error {
|
if let error {
|
||||||
Logging.general.error("Unable to get CloudKit status: \(String(describing: error))")
|
Logging.general.error("Unable to get CloudKit status: \(String(describing: error))")
|
||||||
|
@ -103,7 +99,6 @@ struct AdvancedPrefsView : View {
|
||||||
.lineLimit(nil)
|
.lineLimit(nil)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var cachingSection: some View {
|
var cachingSection: some View {
|
||||||
|
@ -125,9 +120,7 @@ struct AdvancedPrefsView : View {
|
||||||
s += AttributedString("\nMastodon cache size: \(ByteCountFormatter().string(fromByteCount: mastodonCacheSize))")
|
s += AttributedString("\nMastodon cache size: \(ByteCountFormatter().string(fromByteCount: mastodonCacheSize))")
|
||||||
}
|
}
|
||||||
return Text(s)
|
return Text(s)
|
||||||
}
|
}.task {
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
.task {
|
|
||||||
imageCacheSize = [
|
imageCacheSize = [
|
||||||
ImageCache.avatars,
|
ImageCache.avatars,
|
||||||
.headers,
|
.headers,
|
||||||
|
|
|
@ -33,8 +33,7 @@ struct AppearancePrefsView : View {
|
||||||
accountsSection
|
accountsSection
|
||||||
postsSection
|
postsSection
|
||||||
}
|
}
|
||||||
.listStyle(.insetGrouped)
|
.listStyle(InsetGroupedListStyle())
|
||||||
.appGroupedScrollBackgroundIfAvailable()
|
|
||||||
.navigationBarTitle(Text("Appearance"))
|
.navigationBarTitle(Text("Appearance"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +65,6 @@ struct AppearancePrefsView : View {
|
||||||
.onReceive(appearanceChangePublisher) { _ in
|
.onReceive(appearanceChangePublisher) { _ in
|
||||||
NotificationCenter.default.post(name: .themePreferenceChanged, object: nil)
|
NotificationCenter.default.post(name: .themePreferenceChanged, object: nil)
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private var accountsSection: some View {
|
private var accountsSection: some View {
|
||||||
|
@ -78,7 +76,6 @@ struct AppearancePrefsView : View {
|
||||||
Text("Hide Custom Emoji in Usernames")
|
Text("Hide Custom Emoji in Usernames")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private var postsSection: some View {
|
private var postsSection: some View {
|
||||||
|
@ -106,7 +103,6 @@ struct AppearancePrefsView : View {
|
||||||
.navigationTitle("Trailing Swipe Actions")
|
.navigationTitle("Trailing Swipe Actions")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,7 @@ struct BehaviorPrefsView: View {
|
||||||
linksSection
|
linksSection
|
||||||
contentWarningsSection
|
contentWarningsSection
|
||||||
}
|
}
|
||||||
.listStyle(.insetGrouped)
|
.listStyle(InsetGroupedListStyle())
|
||||||
.appGroupedScrollBackgroundIfAvailable()
|
|
||||||
.navigationBarTitle(Text("Behavior"))
|
.navigationBarTitle(Text("Behavior"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +28,6 @@ struct BehaviorPrefsView: View {
|
||||||
Text("Require Confirmation Before Reblogging")
|
Text("Require Confirmation Before Reblogging")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private var timelineSection: some View {
|
private var timelineSection: some View {
|
||||||
|
@ -40,7 +38,6 @@ struct BehaviorPrefsView: View {
|
||||||
} header: {
|
} header: {
|
||||||
Text("Timeline")
|
Text("Timeline")
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private var linksSection: some View {
|
private var linksSection: some View {
|
||||||
|
@ -55,7 +52,6 @@ struct BehaviorPrefsView: View {
|
||||||
Text("Always Use Reader Mode in In-App Safari")
|
Text("Always Use Reader Mode in In-App Safari")
|
||||||
}.disabled(!preferences.useInAppSafari)
|
}.disabled(!preferences.useInAppSafari)
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private var contentWarningsSection: some View {
|
private var contentWarningsSection: some View {
|
||||||
|
@ -72,7 +68,6 @@ struct BehaviorPrefsView: View {
|
||||||
Text(preferences.expandAllContentWarnings ? "Collapse Posts with Keywords in CWs" : "Expand Posts with Keywords in CWs")
|
Text(preferences.expandAllContentWarnings ? "Collapse Posts with Keywords in CWs" : "Expand Posts with Keywords in CWs")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,7 @@ struct ComposingPrefsView: View {
|
||||||
replyingSection
|
replyingSection
|
||||||
writingSection
|
writingSection
|
||||||
}
|
}
|
||||||
.listStyle(.insetGrouped)
|
.listStyle(InsetGroupedListStyle())
|
||||||
.appGroupedScrollBackgroundIfAvailable()
|
|
||||||
.navigationBarTitle("Composing")
|
.navigationBarTitle("Composing")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +51,6 @@ struct ComposingPrefsView: View {
|
||||||
} footer: {
|
} footer: {
|
||||||
Text("When starting a reply, Tusker will use your preferred visibility or the visibility of the post to which you're replying, whichever is narrower.")
|
Text("When starting a reply, Tusker will use your preferred visibility or the visibility of the post to which you're replying, whichever is narrower.")
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var composingSection: some View {
|
var composingSection: some View {
|
||||||
|
@ -64,7 +62,6 @@ struct ComposingPrefsView: View {
|
||||||
Text("Require Attachment Descriptions")
|
Text("Require Attachment Descriptions")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var replyingSection: some View {
|
var replyingSection: some View {
|
||||||
|
@ -78,7 +75,6 @@ struct ComposingPrefsView: View {
|
||||||
Text("Mention Reblogger")
|
Text("Mention Reblogger")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var writingSection: some View {
|
var writingSection: some View {
|
||||||
|
@ -87,7 +83,6 @@ struct ComposingPrefsView: View {
|
||||||
Text("Show @ and # on Keyboard")
|
Text("Show @ and # on Keyboard")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,8 +15,7 @@ struct MediaPrefsView: View {
|
||||||
List {
|
List {
|
||||||
viewingSection
|
viewingSection
|
||||||
}
|
}
|
||||||
.listStyle(.insetGrouped)
|
.listStyle(InsetGroupedListStyle())
|
||||||
.appGroupedScrollBackgroundIfAvailable()
|
|
||||||
.navigationBarTitle("Media")
|
.navigationBarTitle("Media")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +42,6 @@ struct MediaPrefsView: View {
|
||||||
Text("Show Uncropped Media Inline")
|
Text("Show Uncropped Media Inline")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,11 +37,9 @@ struct OppositeCollapseKeywordsView: View {
|
||||||
|
|
||||||
FocusableTextField(placeholder: "Add Keyword", text: $valueToAdd, becomeFirstResponder: $makeAddFieldFirstResponder, onCommit: self.addKeyword)
|
FocusableTextField(placeholder: "Add Keyword", text: $valueToAdd, becomeFirstResponder: $makeAddFieldFirstResponder, onCommit: self.addKeyword)
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
.animation(.default, value: keywords.map(\.id))
|
.animation(.default, value: keywords.map(\.id))
|
||||||
.listStyle(.grouped)
|
.listStyle(GroupedListStyle())
|
||||||
.appGroupedScrollBackgroundIfAvailable()
|
|
||||||
}
|
}
|
||||||
.onAppear(perform: updateAppearance)
|
.onAppear(perform: updateAppearance)
|
||||||
.navigationBarTitle(preferences.expandAllContentWarnings ? "Collapse Post CW Keywords" : "Expand Post CW Keywords")
|
.navigationBarTitle(preferences.expandAllContentWarnings ? "Collapse Post CW Keywords" : "Expand Post CW Keywords")
|
||||||
|
|
|
@ -6,11 +6,11 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
import TTTKit
|
||||||
|
|
||||||
struct PreferencesView: View {
|
struct PreferencesView: View {
|
||||||
let mastodonController: MastodonController
|
let mastodonController: MastodonController
|
||||||
|
@ObservedObject var localData = LocalData.shared
|
||||||
@ObservedObject private var localData = LocalData.shared
|
|
||||||
@State private var showingLogoutConfirmation = false
|
@State private var showingLogoutConfirmation = false
|
||||||
|
|
||||||
init(mastodonController: MastodonController) {
|
init(mastodonController: MastodonController) {
|
||||||
|
@ -18,118 +18,101 @@ struct PreferencesView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
List {
|
// workaround: the navigation view is provided by MyProfileTableViewController so that it can inject the Done button
|
||||||
accountsSection
|
// NavigationView {
|
||||||
preferencesSection
|
List {
|
||||||
aboutSection
|
Section(header: Text("Accounts")) {
|
||||||
}
|
ForEach(localData.accounts, id: \.accessToken) { (account) in
|
||||||
.listStyle(.insetGrouped)
|
Button(action: {
|
||||||
.appGroupedScrollBackgroundIfAvailable()
|
NotificationCenter.default.post(name: .activateAccount, object: nil, userInfo: ["account": account])
|
||||||
.navigationBarTitle("Preferences")
|
}) {
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
HStack {
|
||||||
.onAppear {
|
LocalAccountAvatarView(localAccountInfo: account)
|
||||||
if #unavailable(iOS 16.0) {
|
VStack(alignment: .leading) {
|
||||||
UITableView.appearance(whenContainedInInstancesOf: [PreferencesNavigationController.self]).backgroundColor = .appGroupedBackground
|
Text(verbatim: account.username)
|
||||||
}
|
.foregroundColor(.primary)
|
||||||
}
|
Text(verbatim: account.instanceURL.host!)
|
||||||
}
|
.font(.caption)
|
||||||
|
.foregroundColor(.primary)
|
||||||
private var accountsSection: some View {
|
}
|
||||||
Section {
|
Spacer()
|
||||||
ForEach(localData.accounts, id: \.accessToken) { (account) in
|
if account == mastodonController.accountInfo! {
|
||||||
Button(action: {
|
Image(systemName: "checkmark")
|
||||||
NotificationCenter.default.post(name: .activateAccount, object: nil, userInfo: ["account": account])
|
.renderingMode(.template)
|
||||||
}) {
|
.foregroundColor(.secondary)
|
||||||
HStack {
|
}
|
||||||
LocalAccountAvatarView(localAccountInfo: account)
|
}
|
||||||
VStack(alignment: .leading) {
|
}.onDrag {
|
||||||
Text(verbatim: account.username)
|
let activity = UserActivityManager.mainSceneActivity(accountID: account.id)
|
||||||
.foregroundColor(.primary)
|
return NSItemProvider(object: activity)
|
||||||
Text(verbatim: account.instanceURL.host!)
|
|
||||||
.font(.caption)
|
|
||||||
.foregroundColor(.primary)
|
|
||||||
}
|
}
|
||||||
Spacer()
|
}.onDelete { (indices: IndexSet) in
|
||||||
if account == mastodonController.accountInfo! {
|
var indices = indices
|
||||||
Image(systemName: "checkmark")
|
var logoutFromCurrent = false
|
||||||
.renderingMode(.template)
|
if let index = indices.first(where: { localData.accounts[$0] == mastodonController.accountInfo! }) {
|
||||||
.foregroundColor(.secondary)
|
logoutFromCurrent = true
|
||||||
|
indices.remove(index)
|
||||||
|
}
|
||||||
|
|
||||||
|
indices.forEach { LogoutService(accountInfo: localData.accounts[$0]).run() }
|
||||||
|
|
||||||
|
if logoutFromCurrent {
|
||||||
|
self.logoutPressed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Button(action: {
|
||||||
|
NotificationCenter.default.post(name: .addAccount, object: nil)
|
||||||
|
}) {
|
||||||
|
Text("Add Account...")
|
||||||
|
}
|
||||||
|
if localData.getMostRecentAccount() != nil {
|
||||||
|
Button(action: {
|
||||||
|
self.showingLogoutConfirmation = true
|
||||||
|
}) {
|
||||||
|
Text("Logout from current")
|
||||||
|
}.alert(isPresented: $showingLogoutConfirmation) {
|
||||||
|
Alert(title: Text("Are you sure you want to logout?"), message: nil, primaryButton: .destructive(Text("Logout"), action: self.logoutPressed), secondaryButton: .cancel())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.onDrag {
|
|
||||||
let activity = UserActivityManager.mainSceneActivity(accountID: account.id)
|
|
||||||
return NSItemProvider(object: activity)
|
|
||||||
}
|
|
||||||
}.onDelete { (indices: IndexSet) in
|
|
||||||
var indices = indices
|
|
||||||
var logoutFromCurrent = false
|
|
||||||
if let index = indices.first(where: { localData.accounts[$0] == mastodonController.accountInfo! }) {
|
|
||||||
logoutFromCurrent = true
|
|
||||||
indices.remove(index)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
indices.forEach { LogoutService(accountInfo: localData.accounts[$0]).run() }
|
Section {
|
||||||
|
NavigationLink(destination: AppearancePrefsView()) {
|
||||||
|
Text("Appearance")
|
||||||
|
}
|
||||||
|
NavigationLink(destination: ComposingPrefsView()) {
|
||||||
|
Text("Composing")
|
||||||
|
}
|
||||||
|
NavigationLink(destination: MediaPrefsView()) {
|
||||||
|
Text("Media")
|
||||||
|
}
|
||||||
|
NavigationLink(destination: BehaviorPrefsView()) {
|
||||||
|
Text("Behavior")
|
||||||
|
}
|
||||||
|
NavigationLink(destination: WellnessPrefsView()) {
|
||||||
|
Text("Digital Wellness")
|
||||||
|
}
|
||||||
|
NavigationLink(destination: AdvancedPrefsView()) {
|
||||||
|
Text("Advanced")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if logoutFromCurrent {
|
Section {
|
||||||
self.logoutPressed()
|
NavigationLink("About") {
|
||||||
|
AboutView()
|
||||||
|
}
|
||||||
|
NavigationLink("Tip Jar") {
|
||||||
|
TipJarView()
|
||||||
|
}
|
||||||
|
NavigationLink("Acknowledgements") {
|
||||||
|
AcknowledgementsView()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.listStyle(InsetGroupedListStyle())
|
||||||
Button(action: {
|
.navigationBarTitle(Text("Preferences"), displayMode: .inline)
|
||||||
NotificationCenter.default.post(name: .addAccount, object: nil)
|
// }
|
||||||
}) {
|
|
||||||
Text("Add Account...")
|
|
||||||
}
|
|
||||||
Button(action: {
|
|
||||||
self.showingLogoutConfirmation = true
|
|
||||||
}) {
|
|
||||||
Text("Logout from current")
|
|
||||||
}.alert(isPresented: $showingLogoutConfirmation) {
|
|
||||||
Alert(title: Text("Are you sure you want to logout?"), message: nil, primaryButton: .destructive(Text("Logout"), action: self.logoutPressed), secondaryButton: .cancel())
|
|
||||||
}
|
|
||||||
} header: {
|
|
||||||
Text("Accounts")
|
|
||||||
}
|
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
|
||||||
|
|
||||||
private var preferencesSection: some View {
|
|
||||||
Section {
|
|
||||||
NavigationLink(destination: AppearancePrefsView()) {
|
|
||||||
Text("Appearance")
|
|
||||||
}
|
|
||||||
NavigationLink(destination: ComposingPrefsView()) {
|
|
||||||
Text("Composing")
|
|
||||||
}
|
|
||||||
NavigationLink(destination: MediaPrefsView()) {
|
|
||||||
Text("Media")
|
|
||||||
}
|
|
||||||
NavigationLink(destination: BehaviorPrefsView()) {
|
|
||||||
Text("Behavior")
|
|
||||||
}
|
|
||||||
NavigationLink(destination: WellnessPrefsView()) {
|
|
||||||
Text("Digital Wellness")
|
|
||||||
}
|
|
||||||
NavigationLink(destination: AdvancedPrefsView()) {
|
|
||||||
Text("Advanced")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
|
||||||
|
|
||||||
private var aboutSection: some View {
|
|
||||||
Section {
|
|
||||||
NavigationLink("About") {
|
|
||||||
AboutView()
|
|
||||||
}
|
|
||||||
NavigationLink("Tip Jar") {
|
|
||||||
TipJarView()
|
|
||||||
}
|
|
||||||
NavigationLink("Acknowledgements") {
|
|
||||||
AcknowledgementsView()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func logoutPressed() {
|
func logoutPressed() {
|
||||||
|
@ -137,20 +120,6 @@ struct PreferencesView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension View {
|
|
||||||
@available(iOS, obsoleted: 16.0)
|
|
||||||
@ViewBuilder
|
|
||||||
func appGroupedScrollBackgroundIfAvailable() -> some View {
|
|
||||||
if #available(iOS 16.0, *) {
|
|
||||||
self
|
|
||||||
.scrollContentBackground(.hidden)
|
|
||||||
.background(Color.appGroupedBackground)
|
|
||||||
} else {
|
|
||||||
self
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//#if DEBUG
|
//#if DEBUG
|
||||||
//struct PreferencesView_Previews : PreviewProvider {
|
//struct PreferencesView_Previews : PreviewProvider {
|
||||||
// static var previews: some View {
|
// static var previews: some View {
|
||||||
|
|
|
@ -42,7 +42,6 @@ class SwipeActionsPrefsViewController: UIViewController, UICollectionViewDelegat
|
||||||
override func loadView() {
|
override func loadView() {
|
||||||
let layout = UICollectionViewCompositionalLayout { [unowned self] sectionIndex, environment in
|
let layout = UICollectionViewCompositionalLayout { [unowned self] sectionIndex, environment in
|
||||||
var config = UICollectionLayoutListConfiguration(appearance: .insetGrouped)
|
var config = UICollectionLayoutListConfiguration(appearance: .insetGrouped)
|
||||||
config.backgroundColor = .appGroupedBackground
|
|
||||||
if dataSource.sectionIdentifier(for: sectionIndex) == .selected {
|
if dataSource.sectionIdentifier(for: sectionIndex) == .selected {
|
||||||
config.headerMode = .supplementary
|
config.headerMode = .supplementary
|
||||||
}
|
}
|
||||||
|
@ -60,15 +59,6 @@ class SwipeActionsPrefsViewController: UIViewController, UICollectionViewDelegat
|
||||||
config.image = UIImage(systemName: item.systemImageName)
|
config.image = UIImage(systemName: item.systemImageName)
|
||||||
cell.contentConfiguration = config
|
cell.contentConfiguration = config
|
||||||
cell.accessories = [.reorder(displayed: .always)]
|
cell.accessories = [.reorder(displayed: .always)]
|
||||||
cell.configurationUpdateHandler = { cell, state in
|
|
||||||
var config = UIBackgroundConfiguration.listGroupedCell().updated(for: state)
|
|
||||||
if state.isHighlighted || state.isSelected {
|
|
||||||
config.backgroundColor = .appSelectedCellBackground
|
|
||||||
} else {
|
|
||||||
config.backgroundColor = .appGroupedCellBackground
|
|
||||||
}
|
|
||||||
cell.backgroundConfiguration = config
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
let dataSource = UICollectionViewDiffableDataSource<Section, Item>(collectionView: collectionView) { collectionView, indexPath, itemIdentifier in
|
let dataSource = UICollectionViewDiffableDataSource<Section, Item>(collectionView: collectionView) { collectionView, indexPath, itemIdentifier in
|
||||||
return collectionView.dequeueConfiguredReusableCell(using: listCell, for: indexPath, item: itemIdentifier)
|
return collectionView.dequeueConfiguredReusableCell(using: listCell, for: indexPath, item: itemIdentifier)
|
||||||
|
|
|
@ -26,12 +26,8 @@ struct TipJarView: View {
|
||||||
@StateObject private var observer = UbiquitousKeyValueStoreObserver()
|
@StateObject private var observer = UbiquitousKeyValueStoreObserver()
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack {
|
productsView
|
||||||
Color.appGroupedBackground
|
.overlay {
|
||||||
.edgesIgnoringSafeArea(.all)
|
|
||||||
|
|
||||||
productsView
|
|
||||||
|
|
||||||
if showConfetti {
|
if showConfetti {
|
||||||
ConfettiView()
|
ConfettiView()
|
||||||
.transition(.opacity.animation(.default))
|
.transition(.opacity.animation(.default))
|
||||||
|
|
|
@ -19,8 +19,7 @@ struct WellnessPrefsView: View {
|
||||||
disableInfiniteScrolling
|
disableInfiniteScrolling
|
||||||
hideDiscover
|
hideDiscover
|
||||||
}
|
}
|
||||||
.listStyle(.insetGrouped)
|
.listStyle(InsetGroupedListStyle())
|
||||||
.appGroupedScrollBackgroundIfAvailable()
|
|
||||||
.navigationBarTitle(Text("Digital Wellness"))
|
.navigationBarTitle(Text("Digital Wellness"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +29,6 @@ struct WellnessPrefsView: View {
|
||||||
Text("Favorite and Reblog Counts in Conversations")
|
Text("Favorite and Reblog Counts in Conversations")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private var notificationsMode: some View {
|
private var notificationsMode: some View {
|
||||||
|
@ -41,7 +39,6 @@ struct WellnessPrefsView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private var grayscaleImages: some View {
|
private var grayscaleImages: some View {
|
||||||
|
@ -50,7 +47,6 @@ struct WellnessPrefsView: View {
|
||||||
Text("Grayscale Images")
|
Text("Grayscale Images")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private var disableInfiniteScrolling: some View {
|
private var disableInfiniteScrolling: some View {
|
||||||
|
@ -59,7 +55,6 @@ struct WellnessPrefsView: View {
|
||||||
Text("Disable Infinite Scrolling")
|
Text("Disable Infinite Scrolling")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private var hideDiscover: some View {
|
private var hideDiscover: some View {
|
||||||
|
@ -68,7 +63,6 @@ struct WellnessPrefsView: View {
|
||||||
Text("Hide Discover Section")
|
Text("Hide Discover Section")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listRowBackground(Color.appGroupedCellBackground)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import Pachyderm
|
import Pachyderm
|
||||||
import SwiftUI
|
|
||||||
|
|
||||||
class MyProfileViewController: ProfileViewController {
|
class MyProfileViewController: ProfileViewController {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue