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
}
#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

View file

@ -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,

View file

@ -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 {

View file

@ -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)