From 3020d831e43dae5e7c83fa3dc76b86a42c7b74ab Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Tue, 6 Feb 2024 19:19:53 +0100 Subject: [PATCH] Various fixes --- .../Sources/Account/AccountDetailView.swift | 4 ++++ .../Env/Sources/Env/UserPreferences.swift | 2 +- .../StatusKit/List/StatusesListView.swift | 2 ++ .../Row/Subviews/StatusRowActionsView.swift | 21 ++++++++++--------- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Packages/Account/Sources/Account/AccountDetailView.swift b/Packages/Account/Sources/Account/AccountDetailView.swift index 9fde6778..725a33b9 100644 --- a/Packages/Account/Sources/Account/AccountDetailView.swift +++ b/Packages/Account/Sources/Account/AccountDetailView.swift @@ -254,7 +254,11 @@ public struct AccountDetailView: View { StatusRowView(viewModel: .init(status: status, client: client, routerPath: routerPath)) } Rectangle() + #if os(visionOS) + .fill(Color.clear) + #else .fill(theme.secondaryBackgroundColor) + #endif .frame(height: 12) .listRowInsets(.init()) .listRowSeparator(.hidden) diff --git a/Packages/Env/Sources/Env/UserPreferences.swift b/Packages/Env/Sources/Env/UserPreferences.swift index d0e29635..427378e2 100644 --- a/Packages/Env/Sources/Env/UserPreferences.swift +++ b/Packages/Env/Sources/Env/UserPreferences.swift @@ -52,7 +52,7 @@ import SwiftUI @AppStorage("collapse-long-posts") public var collapseLongPosts = true - @AppStorage("share-button-behavior") public var shareButtonBehavior: PreferredShareButtonBehavior = .linkAndText + @AppStorage("share-button-behavior") public var shareButtonBehavior: PreferredShareButtonBehavior = .linkOnly @AppStorage("fast_refresh") public var fastRefreshEnabled: Bool = false diff --git a/Packages/StatusKit/Sources/StatusKit/List/StatusesListView.swift b/Packages/StatusKit/Sources/StatusKit/List/StatusesListView.swift index e57ba341..913f586d 100644 --- a/Packages/StatusKit/Sources/StatusKit/List/StatusesListView.swift +++ b/Packages/StatusKit/Sources/StatusKit/List/StatusesListView.swift @@ -83,6 +83,8 @@ public struct StatusesListView: View where Fetcher: StatusesFetcher { Spacer() } .padding(.horizontal, .layoutPadding) + #if !os(visionOS) .listRowBackground(theme.primaryBackgroundColor) + #endif } } diff --git a/Packages/StatusKit/Sources/StatusKit/Row/Subviews/StatusRowActionsView.swift b/Packages/StatusKit/Sources/StatusKit/Row/Subviews/StatusRowActionsView.swift index 321049f2..842120f2 100644 --- a/Packages/StatusKit/Sources/StatusKit/Row/Subviews/StatusRowActionsView.swift +++ b/Packages/StatusKit/Sources/StatusKit/Row/Subviews/StatusRowActionsView.swift @@ -143,6 +143,10 @@ struct StatusRowActionsView: View { case .linkOnly: ShareLink(item: url) { action.image(dataController: statusDataController) + .foregroundColor(Color(UIColor.secondaryLabel)) + .padding(.vertical, 6) + .padding(.horizontal, 8) + .contentShape(Rectangle()) #if targetEnvironment(macCatalyst) .font(.scaledBody) #else @@ -150,12 +154,8 @@ struct StatusRowActionsView: View { .dynamicTypeSize(.large) #endif } - .padding(.vertical, 6) - .padding(.horizontal, 8) - #if os(visionOS) .buttonStyle(.borderless) - #else - .buttonStyle(.statusAction()) + #if !os(visionOS) .offset(x: -8) #endif .accessibilityElement(children: .combine) @@ -166,6 +166,10 @@ struct StatusRowActionsView: View { message: Text(viewModel.finalStatus.content.asRawText)) { action.image(dataController: statusDataController) + .foregroundColor(Color(UIColor.secondaryLabel)) + .padding(.vertical, 6) + .padding(.horizontal, 8) + .contentShape(Rectangle()) #if targetEnvironment(macCatalyst) .font(.scaledBody) #else @@ -173,12 +177,8 @@ struct StatusRowActionsView: View { .dynamicTypeSize(.large) #endif } - .padding(.vertical, 6) - .padding(.horizontal, 8) - #if os(visionOS) .buttonStyle(.borderless) - #else - .buttonStyle(.statusAction()) + #if !os(visionOS) .offset(x: -8) #endif .accessibilityElement(children: .combine) @@ -270,6 +270,7 @@ struct StatusRowActionsView: View { } #if os(visionOS) .buttonStyle(.borderless) + .foregroundColor(Color(UIColor.secondaryLabel)) #else .buttonStyle( .statusAction(