mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-06-13 02:39:33 +00:00
More UI
This commit is contained in:
parent
8c64e023b7
commit
ee83f524bd
|
@ -97,7 +97,7 @@ extension View {
|
|||
.preferredColorScheme(Theme.shared.selectedScheme == .dark ? .dark : .light)
|
||||
case .accountPushNotficationsSettings:
|
||||
if let subscription = PushNotificationsService.shared.subscriptions.first(where: { $0.account.token == AppAccountsManager.shared.currentAccount.oauthToken }) {
|
||||
PushNotificationsView(subscription: subscription)
|
||||
PushNotificationsViewWrapper(subscription: subscription)
|
||||
} else {
|
||||
EmptyView()
|
||||
}
|
||||
|
|
|
@ -57,7 +57,9 @@ struct AboutView: View {
|
|||
} footer: {
|
||||
Text("\(versionNumber)©2023 Thomas Ricouard")
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
|
||||
followAccountsSection
|
||||
|
||||
|
@ -94,7 +96,9 @@ struct AboutView: View {
|
|||
Text("settings.about.built-with")
|
||||
.textCase(nil)
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
.task {
|
||||
await fetchAccounts()
|
||||
|
@ -118,12 +122,16 @@ struct AboutView: View {
|
|||
AccountsListRow(viewModel: iceCubesAccount)
|
||||
AccountsListRow(viewModel: dimillianAccount)
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
} else {
|
||||
Section {
|
||||
ProgressView()
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,9 @@ struct AddAccountView: View {
|
|||
NavigationStack {
|
||||
Form {
|
||||
TextField("instance.url", text: $instanceName)
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
.keyboardType(.URL)
|
||||
.textContentType(.URL)
|
||||
.textInputAutocapitalization(.never)
|
||||
|
@ -166,7 +168,9 @@ struct AddAccountView: View {
|
|||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.tintColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private var instancesListView: some View {
|
||||
|
@ -212,11 +216,13 @@ struct AddAccountView: View {
|
|||
.padding(10)
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.background(theme.primaryBackgroundColor)
|
||||
.listRowBackground(Color.clear)
|
||||
.listRowInsets(EdgeInsets(top: 10, leading: 0, bottom: 10, trailing: 0))
|
||||
.listRowSeparator(.hidden)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 5))
|
||||
#endif
|
||||
.overlay {
|
||||
RoundedRectangle(cornerRadius: 5)
|
||||
.stroke(lineWidth: 1)
|
||||
|
@ -251,7 +257,9 @@ struct AddAccountView: View {
|
|||
.redacted(reason: .placeholder)
|
||||
.allowsHitTesting(false)
|
||||
.shimmering()
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private func signIn() async {
|
||||
|
|
|
@ -19,7 +19,10 @@ struct ContentSettingsView: View {
|
|||
Toggle(isOn: $userPreferences.suppressDupeReblogs) {
|
||||
Text("settings.content.hide-repeated-boosts")
|
||||
}
|
||||
}.listRowBackground(theme.primaryBackgroundColor)
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
|
||||
Section("settings.content.media") {
|
||||
Toggle(isOn: $userPreferences.autoPlayVideo) {
|
||||
|
@ -28,7 +31,10 @@ struct ContentSettingsView: View {
|
|||
Toggle(isOn: $userPreferences.showAltTextForMedia) {
|
||||
Text("settings.content.media.show.alt")
|
||||
}
|
||||
}.listRowBackground(theme.primaryBackgroundColor)
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
|
||||
Section("settings.content.sharing") {
|
||||
Picker("settings.content.sharing.share-button-behavior", selection: $userPreferences.shareButtonBehavior) {
|
||||
|
@ -38,14 +44,18 @@ struct ContentSettingsView: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
|
||||
Section("settings.content.instance-settings") {
|
||||
Toggle(isOn: $userPreferences.useInstanceContentSettings) {
|
||||
Text("settings.content.use-instance-settings")
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
.onChange(of: userPreferences.useInstanceContentSettings) { _, newVal in
|
||||
if newVal {
|
||||
userPreferences.appAutoExpandSpoilers = userPreferences.autoExpandSpoilers
|
||||
|
@ -76,7 +86,9 @@ struct ContentSettingsView: View {
|
|||
} footer: {
|
||||
Text("settings.content.collapse-long-posts-hint")
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
|
||||
Section("settings.content.posting") {
|
||||
Picker("settings.content.default-visibility", selection: $userPreferences.appDefaultPostVisibility) {
|
||||
|
@ -104,8 +116,9 @@ struct ContentSettingsView: View {
|
|||
}
|
||||
.disabled(userPreferences.useInstanceContentSettings)
|
||||
}
|
||||
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
.navigationTitle("settings.content.navigation-title")
|
||||
#if !os(visionOS)
|
||||
|
|
|
@ -46,8 +46,10 @@ struct DisplaySettingsView: View {
|
|||
resetSection
|
||||
}
|
||||
.navigationTitle("settings.display.navigation-title")
|
||||
#if !os(visionOS)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
.task(id: localValues.tintColor) {
|
||||
do { try await Task.sleep(for: .microseconds(500)) } catch {}
|
||||
theme.tintColor = localValues.tintColor
|
||||
|
@ -121,7 +123,9 @@ struct DisplaySettingsView: View {
|
|||
Text("settings.display.section.theme.footer")
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private var fontSection: some View {
|
||||
|
@ -173,7 +177,9 @@ struct DisplaySettingsView: View {
|
|||
d[.leading]
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
|
@ -222,7 +228,9 @@ struct DisplaySettingsView: View {
|
|||
}
|
||||
Toggle("settings.display.show-account-popover", isOn: $userPreferences.showAccountPopover)
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
|
@ -232,14 +240,18 @@ struct DisplaySettingsView: View {
|
|||
Section("iPhone") {
|
||||
Toggle("settings.display.show-tab-label", isOn: $userPreferences.showiPhoneTabLabel)
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
if UIDevice.current.userInterfaceIdiom == .pad {
|
||||
Section("iPad") {
|
||||
Toggle("settings.display.show-ipad-column", isOn: $userPreferences.showiPadSecondaryColumn)
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -261,7 +273,9 @@ struct DisplaySettingsView: View {
|
|||
Text("settings.display.restore")
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private var themeSelectorButton: some View {
|
||||
|
|
|
@ -17,10 +17,14 @@ struct HapticSettingsView: View {
|
|||
Toggle("settings.haptic.tab-selection", isOn: $userPreferences.hapticTabSelectionEnabled)
|
||||
Toggle("settings.haptic.buttons", isOn: $userPreferences.hapticButtonPressEnabled)
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
.navigationTitle("settings.haptic.navigation-title")
|
||||
#if !os(visionOS)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,7 +85,9 @@ struct IconSelectorView: View {
|
|||
.padding(6)
|
||||
.navigationTitle("settings.app.icon.navigation-title")
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.background(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private func makeIconGridView(icons: [Icon]) -> some View {
|
||||
|
@ -116,6 +118,7 @@ struct IconSelectorView: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,8 +13,10 @@ struct InstanceInfoView: View {
|
|||
InstanceInfoSection(instance: instance)
|
||||
}
|
||||
.navigationTitle("instance.info.navigation-title")
|
||||
#if !os(visionOS)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,7 +37,9 @@ public struct InstanceInfoSection: View {
|
|||
LabeledContent("instance.info.posts", value: format(instance.stats.statusCount))
|
||||
LabeledContent("instance.info.domains", value: format(instance.stats.domainCount))
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
|
||||
if let rules = instance.rules {
|
||||
Section("instance.info.section.rules") {
|
||||
|
@ -43,7 +47,9 @@ public struct InstanceInfoSection: View {
|
|||
Text(rule.text.trimmingCharacters(in: .whitespacesAndNewlines))
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,27 @@ import NukeUI
|
|||
import SwiftUI
|
||||
import UserNotifications
|
||||
|
||||
struct PushNotificationsViewWrapper: View {
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
public let subscription: PushNotificationSubscriptionSettings
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
PushNotificationsView(subscription: subscription)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
Button {
|
||||
dismiss()
|
||||
} label: {
|
||||
Image(systemName: "xmark.circle")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
struct PushNotificationsView: View {
|
||||
@Environment(Theme.self) private var theme
|
||||
|
@ -33,7 +54,9 @@ struct PushNotificationsView: View {
|
|||
} footer: {
|
||||
Text("settings.push.main-toggle.description")
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
|
||||
if subscription.isEnabled {
|
||||
Section {
|
||||
|
@ -86,7 +109,9 @@ struct PushNotificationsView: View {
|
|||
Label("settings.push.new-posts", systemImage: "bubble.right")
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
Section {
|
||||
|
@ -101,11 +126,15 @@ struct PushNotificationsView: View {
|
|||
} footer: {
|
||||
Text("settings.push.duplicate.footer")
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
.navigationTitle("settings.push.navigation-title")
|
||||
#if !os(visionOS)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
.task {
|
||||
await subscription.fetchSubscription()
|
||||
}
|
||||
|
|
|
@ -45,7 +45,9 @@ struct SettingsTabs: View {
|
|||
cacheSection
|
||||
}
|
||||
.scrollContentBackground(.hidden)
|
||||
#if !os(visionOS)
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
.navigationTitle(Text("settings.title"))
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
|
||||
|
@ -114,7 +116,9 @@ struct SettingsTabs: View {
|
|||
}
|
||||
addAccountButton
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private func logoutAccount(account: AppAccount) async {
|
||||
|
@ -166,7 +170,9 @@ struct SettingsTabs: View {
|
|||
.tint(theme.labelColor)
|
||||
#endif
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
|
@ -204,12 +210,14 @@ struct SettingsTabs: View {
|
|||
Label("settings.other.fast-refresh", systemImage: "arrow.clockwise")
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private var appSection: some View {
|
||||
Section {
|
||||
#if !targetEnvironment(macCatalyst)
|
||||
#if !targetEnvironment(macCatalyst) && !os(visionOS)
|
||||
NavigationLink(destination: IconSelectorView()) {
|
||||
Label {
|
||||
Text("settings.app.icon")
|
||||
|
@ -252,7 +260,9 @@ struct SettingsTabs: View {
|
|||
Text("settings.section.app.footer \(appVersion)").frame(maxWidth: .infinity, alignment: .center)
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private var addAccountButton: some View {
|
||||
|
@ -293,18 +303,24 @@ struct SettingsTabs: View {
|
|||
context.delete(tagGroups[index])
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
|
||||
Button {
|
||||
routerPath.presentedSheet = .addTagGroup
|
||||
} label: {
|
||||
Label("timeline.filter.add-tag-groups", systemImage: "plus")
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
.navigationTitle("timeline.filter.tag-groups")
|
||||
.scrollContentBackground(.hidden)
|
||||
#if !os(visionOS)
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
.toolbar {
|
||||
EditButton()
|
||||
}
|
||||
|
@ -319,17 +335,23 @@ struct SettingsTabs: View {
|
|||
context.delete(localTimelines[index])
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
Button {
|
||||
routerPath.presentedSheet = .addRemoteLocalTimeline
|
||||
} label: {
|
||||
Label("settings.timeline.add", systemImage: "badge.plus.radiowaves.right")
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
.navigationTitle("settings.general.remote-timelines")
|
||||
.scrollContentBackground(.hidden)
|
||||
#if !os(visionOS)
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
.toolbar {
|
||||
EditButton()
|
||||
}
|
||||
|
@ -349,6 +371,8 @@ struct SettingsTabs: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,8 +69,10 @@ struct SupportAppView: View {
|
|||
linksSection
|
||||
}
|
||||
.navigationTitle("settings.support.navigation-title")
|
||||
#if !os(visionOS)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
.alert("settings.support.alert.title", isPresented: $purchaseSuccessDisplayed, actions: {
|
||||
Button { purchaseSuccessDisplayed = false } label: { Text("alert.button.ok") }
|
||||
}, message: {
|
||||
|
@ -151,7 +153,9 @@ struct SupportAppView: View {
|
|||
Text("settings.support.message-from-dev")
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private var subscriptionSection: some View {
|
||||
|
@ -188,7 +192,9 @@ struct SupportAppView: View {
|
|||
Text("settings.support.supporter.subscription-info")
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private var tipsSection: some View {
|
||||
|
@ -213,7 +219,9 @@ struct SupportAppView: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private var restorePurchase: some View {
|
||||
|
@ -232,7 +240,9 @@ struct SupportAppView: View {
|
|||
} footer: {
|
||||
Text("settings.support.restore-purchase.explanation")
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private var linksSection: some View {
|
||||
|
@ -252,7 +262,9 @@ struct SupportAppView: View {
|
|||
.buttonStyle(.borderless)
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private var loadingPlaceholder: some View {
|
||||
|
|
|
@ -46,7 +46,9 @@ struct SwipeActionsSettingsView: View {
|
|||
} footer: {
|
||||
Text("settings.swipeactions.status.explanation")
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
|
||||
Section {
|
||||
Picker(selection: $userPreferences.swipeActionsIconStyle, label: Text("settings.swipeactions.icon-style")) {
|
||||
|
@ -62,11 +64,15 @@ struct SwipeActionsSettingsView: View {
|
|||
} footer: {
|
||||
Text("settings.swipeactions.use-theme-colors-explanation")
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
.navigationTitle("settings.swipeactions.navigation-title")
|
||||
#if !os(visionOS)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private func createStatusActionPicker(selection: Binding<StatusAction>, label: LocalizedStringKey) -> some View {
|
||||
|
|
|
@ -21,7 +21,9 @@ struct TranslationSettingsView: View {
|
|||
.onAppear {
|
||||
readValue()
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
|
||||
if apiKey.isEmpty {
|
||||
Section {
|
||||
|
@ -30,14 +32,18 @@ struct TranslationSettingsView: View {
|
|||
.foregroundColor(.red)
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
autoDetectSection
|
||||
}
|
||||
.navigationTitle("settings.translation.navigation-title")
|
||||
#if !os(visionOS)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
.onChange(of: apiKey) {
|
||||
writeNewValue()
|
||||
}
|
||||
|
@ -50,7 +56,9 @@ struct TranslationSettingsView: View {
|
|||
Toggle(isOn: $preferences.alwaysUseDeepl) {
|
||||
Text("settings.translation.always-deepl")
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
|
|
|
@ -21,9 +21,10 @@ enum Tab: Int, Identifiable, Hashable {
|
|||
|
||||
static func loggedInTabs() -> [Tab] {
|
||||
if UIDevice.current.userInterfaceIdiom == .pad ||
|
||||
UIDevice.current.userInterfaceIdiom == .mac ||
|
||||
UIDevice.current.userInterfaceIdiom == .vision {
|
||||
UIDevice.current.userInterfaceIdiom == .mac {
|
||||
[.timeline, .trending, .federated, .local, .notifications, .mentions, .explore, .messages, .settings]
|
||||
} else if UIDevice.current.userInterfaceIdiom == .vision {
|
||||
[.profile, .timeline, .trending, .federated, .local, .notifications, .mentions, .explore, .messages, .settings]
|
||||
} else {
|
||||
[.timeline, .notifications, .explore, .messages, .profile]
|
||||
}
|
||||
|
|
|
@ -74,7 +74,9 @@ struct AccountDetailHeaderView: View {
|
|||
.frame(height: Constants.headerHeight)
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
.frame(height: Constants.headerHeight)
|
||||
.onTapGesture {
|
||||
guard account.haveHeader else {
|
||||
|
@ -320,7 +322,9 @@ struct AccountDetailHeaderView: View {
|
|||
Text(note)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.padding(8)
|
||||
#if !os(visionOS)
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
.cornerRadius(4)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 4)
|
||||
|
@ -370,7 +374,11 @@ struct AccountDetailHeaderView: View {
|
|||
.padding(8)
|
||||
.accessibilityElement(children: .contain)
|
||||
.accessibilityLabel("accessibility.tabs.profile.fields.container.label")
|
||||
#if os(visionOS)
|
||||
.background(Material.thick)
|
||||
#else
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
.cornerRadius(4)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 4)
|
||||
|
|
|
@ -84,8 +84,10 @@ public struct AccountDetailView: View {
|
|||
}
|
||||
.environment(\.defaultMinListRowHeight, 1)
|
||||
.listStyle(.plain)
|
||||
#if !os(visionOS)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
.onChange(of: scrollToTopSignal) {
|
||||
withAnimation {
|
||||
proxy.scrollTo(ScrollToView.Constants.scrollToTop, anchor: .top)
|
||||
|
@ -216,7 +218,9 @@ public struct AccountDetailView: View {
|
|||
.padding(.leading, -4)
|
||||
.accessibilityLabel(account.safeDisplayName)
|
||||
|
||||
}.accessibilityAddTraits(.isImage)
|
||||
}
|
||||
.accessibilityAddTraits(.isImage)
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
}
|
||||
.padding(.leading, .layoutPadding + 4)
|
||||
|
@ -235,7 +239,9 @@ public struct AccountDetailView: View {
|
|||
Spacer()
|
||||
Image(systemName: "chevron.right")
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
}.task {
|
||||
await currentAccount.fetchFollowedTags()
|
||||
|
@ -250,7 +256,9 @@ public struct AccountDetailView: View {
|
|||
.font(.scaledHeadline)
|
||||
.foregroundColor(theme.labelColor)
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
.contextMenu {
|
||||
Button("account.list.delete", role: .destructive) {
|
||||
Task {
|
||||
|
@ -264,7 +272,9 @@ public struct AccountDetailView: View {
|
|||
}
|
||||
.tint(theme.tintColor)
|
||||
.buttonStyle(.borderless)
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
.task {
|
||||
await currentAccount.fetchLists()
|
||||
|
@ -284,7 +294,9 @@ public struct AccountDetailView: View {
|
|||
bottom: 0,
|
||||
trailing: .layoutPadding))
|
||||
.listRowSeparator(.hidden)
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
ForEach(viewModel.pinned) { status in
|
||||
StatusRowView(viewModel: .init(status: status, client: client, routerPath: routerPath))
|
||||
}
|
||||
|
@ -403,7 +415,9 @@ extension View {
|
|||
func applyAccountDetailsRowStyle(theme: Theme) -> some View {
|
||||
listRowInsets(.init())
|
||||
.listRowSeparator(.hidden)
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,9 @@ public struct AccountsListView: View {
|
|||
.redacted(reason: .placeholder)
|
||||
.allowsHitTesting(false)
|
||||
.shimmering()
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
case let .display(accounts, relationships, nextPageState):
|
||||
if case .followers = viewModel.mode,
|
||||
|
@ -49,7 +51,9 @@ public struct AccountsListView: View {
|
|||
}
|
||||
}
|
||||
)
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +62,9 @@ public struct AccountsListView: View {
|
|||
if let relationship = relationships.first(where: { $0.id == account.id }) {
|
||||
AccountsListRow(viewModel: .init(account: account,
|
||||
relationShip: relationship))
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +72,9 @@ public struct AccountsListView: View {
|
|||
switch nextPageState {
|
||||
case .hasNextPage:
|
||||
loadingRow
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
.onAppear {
|
||||
Task {
|
||||
await viewModel.fetchNextPage()
|
||||
|
@ -75,18 +83,24 @@ public struct AccountsListView: View {
|
|||
|
||||
case .loadingNextPage:
|
||||
loadingRow
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
case .none:
|
||||
EmptyView()
|
||||
}
|
||||
|
||||
case let .error(error):
|
||||
Text(error.localizedDescription)
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
.listStyle(.plain)
|
||||
.navigationTitle(viewModel.mode.title)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
|
|
|
@ -28,9 +28,9 @@ public struct EditAccountView: View {
|
|||
}
|
||||
}
|
||||
.environment(\.editMode, .constant(.active))
|
||||
#if !os(visionOS)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
#if !os(visionOS)
|
||||
.scrollDismissesKeyboard(.immediately)
|
||||
#endif
|
||||
.navigationTitle("account.edit.navigation-title")
|
||||
|
@ -58,7 +58,9 @@ public struct EditAccountView: View {
|
|||
Spacer()
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
|
@ -71,7 +73,9 @@ public struct EditAccountView: View {
|
|||
TextField("account.edit.about", text: $viewModel.note, axis: .vertical)
|
||||
.frame(maxHeight: 150)
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private var postSettingsSection: some View {
|
||||
|
@ -91,7 +95,9 @@ public struct EditAccountView: View {
|
|||
Label("account.edit.post-settings.sensitive", systemImage: "eye")
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private var accountSection: some View {
|
||||
|
@ -106,7 +112,9 @@ public struct EditAccountView: View {
|
|||
Label("account.edit.account-settings.discoverable", systemImage: "magnifyingglass")
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private var fieldsSection: some View {
|
||||
|
@ -140,7 +148,9 @@ public struct EditAccountView: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
@ToolbarContentBuilder
|
||||
|
|
|
@ -18,10 +18,14 @@ public struct EditRelationshipNoteView: View {
|
|||
TextField("account.relation.note.edit.placeholder", text: $viewModel.note, axis: .vertical)
|
||||
.frame(minHeight: 150, maxHeight: 150, alignment: .top)
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
.navigationTitle("account.relation.note.edit")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
|
|
|
@ -70,11 +70,11 @@ struct EditFilterView: View {
|
|||
}
|
||||
.navigationTitle(filter?.title ?? NSLocalizedString("filter.new", comment: ""))
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.scrollContentBackground(.hidden)
|
||||
#if !os(visionOS)
|
||||
.scrollContentBackground(.hidden)
|
||||
.scrollDismissesKeyboard(.interactively)
|
||||
#endif
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
.onAppear {
|
||||
if filter == nil {
|
||||
focusedField = .title
|
||||
|
@ -106,7 +106,9 @@ struct EditFilterView: View {
|
|||
.disabled(expirySelection != .custom)
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
|
@ -120,7 +122,9 @@ struct EditFilterView: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
|
||||
if filter == nil, !title.isEmpty {
|
||||
Section {
|
||||
|
@ -140,7 +144,9 @@ struct EditFilterView: View {
|
|||
.buttonStyle(.borderedProminent)
|
||||
.transition(.opacity)
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -194,7 +200,9 @@ struct EditFilterView: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private var contextsSection: some View {
|
||||
|
@ -216,7 +224,9 @@ struct EditFilterView: View {
|
|||
}
|
||||
.disabled(isSavingFilter)
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -237,7 +247,9 @@ struct EditFilterView: View {
|
|||
}
|
||||
.pickerStyle(.inline)
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
private var saveButton: some View {
|
||||
|
|
|
@ -54,7 +54,9 @@ public struct FiltersListView: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
|
||||
Section {
|
||||
|
@ -62,15 +64,19 @@ public struct FiltersListView: View {
|
|||
Label("filter.new", systemImage: "plus")
|
||||
}
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
.toolbar {
|
||||
toolbarContent
|
||||
}
|
||||
.navigationTitle("filter.filters")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
#if !os(visionOS)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
.task {
|
||||
do {
|
||||
isLoading = true
|
||||
|
|
|
@ -96,11 +96,8 @@ public struct AppAccountsSelectorView: View {
|
|||
AppAccountView(viewModel: viewModel)
|
||||
}
|
||||
}
|
||||
#if os(visionOS)
|
||||
.listRowBackground(RoundedRectangle(cornerRadius: 8)
|
||||
.foregroundStyle(Material.regular))
|
||||
#else
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
|
||||
if accountCreationEnabled {
|
||||
|
@ -116,11 +113,8 @@ public struct AppAccountsSelectorView: View {
|
|||
}
|
||||
settingsButton
|
||||
}
|
||||
#if os(visionOS)
|
||||
.listRowBackground(Rectangle()
|
||||
.foregroundStyle(Material.regular))
|
||||
#else
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#if !os(visionOS)
|
||||
.listRowBackground(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,8 +70,10 @@ public struct ConversationDetailView: View {
|
|||
}
|
||||
}
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
#if !os(visionOS)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .principal) {
|
||||
if viewModel.conversation.accounts.count == 1,
|
||||
|
|
|
@ -43,7 +43,11 @@ struct ConversationMessageView: View {
|
|||
routerPath.handleStatus(status: message, url: url)
|
||||
})
|
||||
}
|
||||
#if os(visionOS)
|
||||
.background(isOwnMessage ? Material.ultraThick : Material.regular)
|
||||
#else
|
||||
.background(isOwnMessage ? theme.tintColor.opacity(0.2) : theme.secondaryBackgroundColor)
|
||||
#endif
|
||||
.cornerRadius(8)
|
||||
.padding(.leading, isOwnMessage ? 24 : 0)
|
||||
.padding(.trailing, isOwnMessage ? 0 : 24)
|
||||
|
|
|
@ -85,6 +85,8 @@ struct ConversationsListRow: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.hoverEffectDisabled()
|
||||
}
|
||||
|
||||
private var actionsView: some View {
|
||||
|
|
|
@ -81,8 +81,10 @@ public struct ConversationsListView: View {
|
|||
}
|
||||
.padding(.top, .layoutPadding)
|
||||
}
|
||||
#if !os(visionOS)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(theme.primaryBackgroundColor)
|
||||
#endif
|
||||
.navigationTitle("conversations.navigation-title")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
|
|
Loading…
Reference in a new issue