diff --git a/Packages/GalleryVC/Sources/GalleryVC/GalleryItemViewController.swift b/Packages/GalleryVC/Sources/GalleryVC/GalleryItemViewController.swift index 47710da9..22ae5472 100644 --- a/Packages/GalleryVC/Sources/GalleryVC/GalleryItemViewController.swift +++ b/Packages/GalleryVC/Sources/GalleryVC/GalleryItemViewController.swift @@ -102,6 +102,7 @@ class GalleryItemViewController: UIViewController { shareButton.pointerStyleProvider = { button, effect, shape in return UIPointerStyle(effect: .highlight(effect.preview), shape: .roundedRect(button.frame)) } + shareButton.preferredBehavioralStyle = .pad shareButton.translatesAutoresizingMaskIntoConstraints = false updateShareButton() topControlsView.addSubview(shareButton) @@ -118,6 +119,7 @@ class GalleryItemViewController: UIViewController { closeButton.pointerStyleProvider = { button, effect, shape in return UIPointerStyle(effect: .highlight(effect.preview), shape: .roundedRect(button.frame)) } + closeButton.preferredBehavioralStyle = .pad closeButton.translatesAutoresizingMaskIntoConstraints = false topControlsView.addSubview(closeButton) @@ -152,10 +154,15 @@ class GalleryItemViewController: UIViewController { updateCaptionTextView() bottomControlsView.addArrangedSubview(captionTextView) - closeButtonTrailingConstraint = topControlsView.trailingAnchor.constraint(equalTo: closeButton.trailingAnchor) + #if targetEnvironment(macCatalyst) + closeButtonTopConstraint = closeButton.topAnchor.constraint(equalTo: topControlsView.safeAreaLayoutGuide.topAnchor) + shareButtonTopConstraint = shareButton.topAnchor.constraint(equalTo: topControlsView.safeAreaLayoutGuide.topAnchor) + #else closeButtonTopConstraint = closeButton.topAnchor.constraint(equalTo: topControlsView.topAnchor) - shareButtonLeadingConstraint = shareButton.leadingAnchor.constraint(equalTo: topControlsView.leadingAnchor) shareButtonTopConstraint = shareButton.topAnchor.constraint(equalTo: topControlsView.topAnchor) + #endif + closeButtonTrailingConstraint = topControlsView.trailingAnchor.constraint(equalTo: closeButton.trailingAnchor) + shareButtonLeadingConstraint = shareButton.leadingAnchor.constraint(equalTo: topControlsView.leadingAnchor) NSLayoutConstraint.activate([ scrollView.leadingAnchor.constraint(equalTo: view.leadingAnchor),