From 1d552d38f584dda863f5116b3dbb908faf63e051 Mon Sep 17 00:00:00 2001 From: CMK Date: Tue, 11 May 2021 16:44:23 +0800 Subject: [PATCH] fix: visibility icon layout issue --- Mastodon/Scene/Share/View/Content/StatusView.swift | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Mastodon/Scene/Share/View/Content/StatusView.swift b/Mastodon/Scene/Share/View/Content/StatusView.swift index c06c956e0..5ebdd17c5 100644 --- a/Mastodon/Scene/Share/View/Content/StatusView.swift +++ b/Mastodon/Scene/Share/View/Content/StatusView.swift @@ -295,7 +295,7 @@ extension StatusView { authorMetaContainerStackView.axis = .vertical authorMetaContainerStackView.spacing = 4 - // title container: [display name | "·" | date] + // title container: [display name | "·" | date | padding | visibility] let titleContainerStackView = UIStackView() authorMetaContainerStackView.addArrangedSubview(titleContainerStackView) titleContainerStackView.axis = .horizontal @@ -308,12 +308,15 @@ extension StatusView { titleContainerStackView.alignment = .firstBaseline titleContainerStackView.addArrangedSubview(nameTrialingDotLabel) titleContainerStackView.addArrangedSubview(dateLabel) + titleContainerStackView.addArrangedSubview(UIView()) // padding + titleContainerStackView.addArrangedSubview(visibilityImageView) nameLabel.setContentHuggingPriority(.defaultHigh + 1, for: .horizontal) nameTrialingDotLabel.setContentHuggingPriority(.defaultHigh + 2, for: .horizontal) nameTrialingDotLabel.setContentCompressionResistancePriority(.required - 2, for: .horizontal) dateLabel.setContentHuggingPriority(.defaultHigh, for: .horizontal) dateLabel.setContentCompressionResistancePriority(.required - 1, for: .horizontal) - + visibilityImageView.setContentHuggingPriority(.defaultHigh + 3, for: .horizontal) + // subtitle container: [username] let subtitleContainerStackView = UIStackView() authorMetaContainerStackView.addArrangedSubview(subtitleContainerStackView) @@ -324,10 +327,6 @@ extension StatusView { authorContainerStackView.addArrangedSubview(revealContentWarningButton) revealContentWarningButton.setContentHuggingPriority(.required - 2, for: .horizontal) - // visibility ImageView - authorContainerStackView.addArrangedSubview(visibilityImageView) - visibilityImageView.setContentHuggingPriority(.required - 2, for: .horizontal) - authorContainerStackView.translatesAutoresizingMaskIntoConstraints = false authorContainerView.addSubview(authorContainerStackView) NSLayoutConstraint.activate([