From 3eb373550ed84246228dbbccbe3c3abc70a49977 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Tue, 19 Dec 2023 15:07:51 +0100 Subject: [PATCH] visionOS: Fixes --- .../Status/Sources/Status/Detail/StatusDetailView.swift | 4 ++-- Packages/Status/Sources/Status/Row/StatusRowView.swift | 3 ++- .../Status/Row/Subviews/StatusRowMediaPreviewView.swift | 6 ++++-- .../Timeline/Sources/Timeline/PendingStatusesObserver.swift | 5 +++++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Packages/Status/Sources/Status/Detail/StatusDetailView.swift b/Packages/Status/Sources/Status/Detail/StatusDetailView.swift index 3e2ca2ef..e7ed23ba 100644 --- a/Packages/Status/Sources/Status/Detail/StatusDetailView.swift +++ b/Packages/Status/Sources/Status/Detail/StatusDetailView.swift @@ -55,15 +55,15 @@ public struct StatusDetailView: View { loadingContextView } + #if !os(visionOS) Rectangle() .foregroundColor(theme.secondaryBackgroundColor) .frame(minHeight: reader.frame(in: .local).size.height - statusHeight) .listRowSeparator(.hidden) - #if !os(visionOS) .listRowBackground(theme.secondaryBackgroundColor) - #endif .listRowInsets(.init()) .accessibilityHidden(true) + #endif case .error: errorView diff --git a/Packages/Status/Sources/Status/Row/StatusRowView.swift b/Packages/Status/Sources/Status/Row/StatusRowView.swift index 947b4d21..09e5a2cd 100644 --- a/Packages/Status/Sources/Status/Row/StatusRowView.swift +++ b/Packages/Status/Sources/Status/Row/StatusRowView.swift @@ -152,8 +152,9 @@ public struct StatusRowView: View { #if os(visionOS) .listRowBackground(RoundedRectangle(cornerRadius: 8) .foregroundStyle(Material.regular)) + .listRowHoverEffect(.lift) #else - .listRowBackground(viewModel.highlightRowColor) + .listRowBackground(viewModel.highlightRowColor) #endif .listRowInsets(.init(top: 12, leading: .layoutPadding, diff --git a/Packages/Status/Sources/Status/Row/Subviews/StatusRowMediaPreviewView.swift b/Packages/Status/Sources/Status/Row/Subviews/StatusRowMediaPreviewView.swift index b1406f2f..92e4b605 100644 --- a/Packages/Status/Sources/Status/Row/Subviews/StatusRowMediaPreviewView.swift +++ b/Packages/Status/Sources/Status/Row/Subviews/StatusRowMediaPreviewView.swift @@ -22,14 +22,16 @@ public struct StatusRowMediaPreviewView: View { @State private var isQuickLookLoading: Bool = false var availableWidth: CGFloat { - #if !os(visionOS) + #if os(visionOS) + return sceneDelegate.windowWidth * 0.96 + #else if UIDevice.current.userInterfaceIdiom == .phone && (UIDevice.current.orientation == .landscapeLeft || UIDevice.current.orientation == .landscapeRight) || theme.statusDisplayStyle == .medium { return sceneDelegate.windowWidth * 0.80 } - #endif return sceneDelegate.windowWidth + #endif } var appLayoutWidth: CGFloat { diff --git a/Packages/Timeline/Sources/Timeline/PendingStatusesObserver.swift b/Packages/Timeline/Sources/Timeline/PendingStatusesObserver.swift index 1f233bc9..baac37ab 100644 --- a/Packages/Timeline/Sources/Timeline/PendingStatusesObserver.swift +++ b/Packages/Timeline/Sources/Timeline/PendingStatusesObserver.swift @@ -41,8 +41,13 @@ struct PendingStatusesObserverView: View { } .accessibilityLabel("accessibility.tabs.timeline.unread-posts.label-\(observer.pendingStatusesCount)") .accessibilityHint("accessibility.tabs.timeline.unread-posts.hint") + #if os(visionOS) + .buttonStyle(.bordered) + .tint(Material.thick) + #else .buttonStyle(.bordered) .background(.thinMaterial) + #endif .cornerRadius(8) .padding(12) .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: preferences.pendingLocation)