From a93a4fccc14bc84dc61d74b9c328294b4430b910 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 7 Nov 2023 22:31:57 -0500 Subject: [PATCH] visionOS: Fix timeline jump button appearance --- Tusker/Screens/Timeline/TimelineJumpButton.swift | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Tusker/Screens/Timeline/TimelineJumpButton.swift b/Tusker/Screens/Timeline/TimelineJumpButton.swift index 2f1cf090..46faf97d 100644 --- a/Tusker/Screens/Timeline/TimelineJumpButton.swift +++ b/Tusker/Screens/Timeline/TimelineJumpButton.swift @@ -13,15 +13,23 @@ class TimelineJumpButton: UIView { var action: ((Mode) async -> Void)? override var intrinsicContentSize: CGSize { + #if os(visionOS) + CGSize(width: 44, height: 44) + #else CGSize(width: UIView.noIntrinsicMetric, height: 44) + #endif } private let button: UIButton = { + #if os(visionOS) + var config = UIButton.Configuration.borderedProminent() + #else var config = UIButton.Configuration.plain() - config.image = UIImage(systemName: "arrow.up") - config.contentInsets = .zero // We don't want a background for this button, even when accessibility button shapes are enabled, because it's in the navbar. config.background.backgroundColor = .clear + #endif + config.image = UIImage(systemName: "arrow.up") + config.contentInsets = .zero return UIButton(configuration: config) }() @@ -101,8 +109,7 @@ class TimelineJumpButton: UIView { } self.mode = mode - var config = UIButton.Configuration.plain() - config.contentInsets = .zero + var config = button.configuration! switch mode { case .jump: config.image = UIImage(systemName: "arrow.up")