diff --git a/Tusker/Screens/Utilities/CustomAlertController.swift b/Tusker/Screens/Utilities/CustomAlertController.swift index 870709de78..b5cd14bd68 100644 --- a/Tusker/Screens/Utilities/CustomAlertController.swift +++ b/Tusker/Screens/Utilities/CustomAlertController.swift @@ -76,6 +76,7 @@ class CustomAlertController: UIViewController { let titleLabel = UILabel() titleLabel.text = config.title titleLabel.font = UIFont(descriptor: .preferredFontDescriptor(withTextStyle: .body).withSymbolicTraits(.traitBold)!, size: 0) + titleLabel.adjustsFontForContentSizeCategory = true titleLabel.numberOfLines = 0 titleLabel.textAlignment = .center stack.addArrangedSubview(titleLabel) @@ -361,13 +362,14 @@ class CustomAlertActionButton: UIControl { let label = UILabel() label.text = title label.textColor = .tintColor - switch action.style { - case .cancel: + label.adjustsFontForContentSizeCategory = true + if case .cancel = action.style { label.font = UIFont(descriptor: .preferredFontDescriptor(withTextStyle: .body).withSymbolicTraits(.traitBold)!, size: 0) - case .destructive: + } else { + label.font = .preferredFont(forTextStyle: .body) + } + if case .destructive = action.style { label.textColor = .systemRed - default: - break } titleView.addArrangedSubview(label) } diff --git a/Tusker/Views/ConfirmReblogStatusPreviewView.swift b/Tusker/Views/ConfirmReblogStatusPreviewView.swift index 89028ebe8e..1d68ee6b68 100644 --- a/Tusker/Views/ConfirmReblogStatusPreviewView.swift +++ b/Tusker/Views/ConfirmReblogStatusPreviewView.swift @@ -55,6 +55,7 @@ class ConfirmReblogStatusPreviewView: UIView { let displayNameLabel = EmojiLabel() displayNameLabel.font = UIFont(descriptor: .preferredFontDescriptor(withTextStyle: .caption1).addingAttributes([.traits: [UIFontDescriptor.TraitKey.weight: UIFont.Weight.semibold]]), size: 0) displayNameLabel.adjustsFontSizeToFitWidth = true + displayNameLabel.adjustsFontForContentSizeCategory = true displayNameLabel.updateForAccountDisplayName(account: status.account) vStack.addArrangedSubview(displayNameLabel) @@ -64,6 +65,7 @@ class ConfirmReblogStatusPreviewView: UIView { contentView.isScrollEnabled = false contentView.backgroundColor = nil contentView.textContainerInset = .zero + contentView.adjustsFontForContentSizeCategory = true // remove the extra line spacing applied by StatusContentTextView because, since we're using a smaller font, the regular 2pt looks big contentView.paragraphStyle = .default // TODO: line limit