Few improvements

This commit is contained in:
Lumaa 2024-03-23 09:50:12 +01:00
parent 3156877eff
commit 19d0fa3290
4 changed files with 19 additions and 7 deletions

View File

@ -69,10 +69,17 @@ extension View {
.toolbarBackground(Color.appBackground, for: .navigationBar)
.listStyle(.inset)
}
func listRowThreaded() -> some View {
self
.listRowSeparator(.hidden)
.listRowBackground(Color.appBackground)
.tint(Color.blue)
}
func accountRowLabel(_ foreground: Color) -> some View {
self
.multilineTextAlignment(.leading)
.font(.headline.bold().width(.condensed))
.foregroundStyle(foreground)
}
}

View File

@ -188,13 +188,11 @@ struct DiscoveryView: View {
VStack(spacing: 7.5) {
AccountRow(acct: "Threaded@mastodon.online") {
Text("accounts.official")
.font(.headline.bold().width(.condensed))
.foregroundStyle(.green)
.accountRowLabel(.green)
}
AccountRow(acct: "lumaa@mastodon.online") {
Text("accounts.developer")
.font(.headline.bold().width(.condensed))
.foregroundStyle(.blue)
.accountRowLabel(.blue)
}
}
}

View File

@ -19,11 +19,12 @@ struct AboutView: View {
Toggle("setting.experimental.activate", isOn: $userPreferences.showExperimental)
.listRowThreaded()
.tint(Color(uiColor: UIColor.label))
.disabled(!AppDelegate.hasPlus())
.onAppear {
do {
let oldPreferences = try UserPreferences.loadAsCurrent() ?? UserPreferences.defaultPreferences
userPreferences.showExperimental = oldPreferences.showExperimental
userPreferences.showExperimental = oldPreferences.showExperimental && AppDelegate.hasPlus()
} catch {
print(error)
}

View File

@ -80,7 +80,13 @@ struct SettingsView: View {
Button {
navigator.presentedCover = .shop
} label: {
Label(String("Threaded+"), systemImage: "plus")
Label {
Text(String("Threaded+"))
} icon: {
Image("HeroPlus")
.resizable()
.scaledToFit()
}
}
.listRowThreaded()
@ -131,10 +137,10 @@ struct SettingsView: View {
.listRowThreaded()
}
}
.environmentObject(navigator)
.withAppRouter(navigator)
.withCovers(sheetDestination: $navigator.presentedCover)
.listThreaded()
.environmentObject(navigator)
.navigationTitle("settings")
.navigationBarTitleDisplayMode(.inline)
}