visionOS: Fixes

This commit is contained in:
Thomas Ricouard 2023-12-19 15:07:51 +01:00
parent 2fdaed7df4
commit 3eb373550e
4 changed files with 13 additions and 5 deletions

View file

@ -55,15 +55,15 @@ public struct StatusDetailView: View {
loadingContextView loadingContextView
} }
#if !os(visionOS)
Rectangle() Rectangle()
.foregroundColor(theme.secondaryBackgroundColor) .foregroundColor(theme.secondaryBackgroundColor)
.frame(minHeight: reader.frame(in: .local).size.height - statusHeight) .frame(minHeight: reader.frame(in: .local).size.height - statusHeight)
.listRowSeparator(.hidden) .listRowSeparator(.hidden)
#if !os(visionOS)
.listRowBackground(theme.secondaryBackgroundColor) .listRowBackground(theme.secondaryBackgroundColor)
#endif
.listRowInsets(.init()) .listRowInsets(.init())
.accessibilityHidden(true) .accessibilityHidden(true)
#endif
case .error: case .error:
errorView errorView

View file

@ -152,8 +152,9 @@ public struct StatusRowView: View {
#if os(visionOS) #if os(visionOS)
.listRowBackground(RoundedRectangle(cornerRadius: 8) .listRowBackground(RoundedRectangle(cornerRadius: 8)
.foregroundStyle(Material.regular)) .foregroundStyle(Material.regular))
.listRowHoverEffect(.lift)
#else #else
.listRowBackground(viewModel.highlightRowColor) .listRowBackground(viewModel.highlightRowColor)
#endif #endif
.listRowInsets(.init(top: 12, .listRowInsets(.init(top: 12,
leading: .layoutPadding, leading: .layoutPadding,

View file

@ -22,14 +22,16 @@ public struct StatusRowMediaPreviewView: View {
@State private var isQuickLookLoading: Bool = false @State private var isQuickLookLoading: Bool = false
var availableWidth: CGFloat { var availableWidth: CGFloat {
#if !os(visionOS) #if os(visionOS)
return sceneDelegate.windowWidth * 0.96
#else
if UIDevice.current.userInterfaceIdiom == .phone && if UIDevice.current.userInterfaceIdiom == .phone &&
(UIDevice.current.orientation == .landscapeLeft || UIDevice.current.orientation == .landscapeRight) || theme.statusDisplayStyle == .medium (UIDevice.current.orientation == .landscapeLeft || UIDevice.current.orientation == .landscapeRight) || theme.statusDisplayStyle == .medium
{ {
return sceneDelegate.windowWidth * 0.80 return sceneDelegate.windowWidth * 0.80
} }
#endif
return sceneDelegate.windowWidth return sceneDelegate.windowWidth
#endif
} }
var appLayoutWidth: CGFloat { var appLayoutWidth: CGFloat {

View file

@ -41,8 +41,13 @@ struct PendingStatusesObserverView: View {
} }
.accessibilityLabel("accessibility.tabs.timeline.unread-posts.label-\(observer.pendingStatusesCount)") .accessibilityLabel("accessibility.tabs.timeline.unread-posts.label-\(observer.pendingStatusesCount)")
.accessibilityHint("accessibility.tabs.timeline.unread-posts.hint") .accessibilityHint("accessibility.tabs.timeline.unread-posts.hint")
#if os(visionOS)
.buttonStyle(.bordered)
.tint(Material.thick)
#else
.buttonStyle(.bordered) .buttonStyle(.bordered)
.background(.thinMaterial) .background(.thinMaterial)
#endif
.cornerRadius(8) .cornerRadius(8)
.padding(12) .padding(12)
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: preferences.pendingLocation) .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: preferences.pendingLocation)