adjust message request buttons styling

This commit is contained in:
kate-signal 2026-05-15 13:24:01 -04:00 committed by GitHub
parent 7984addb13
commit b789a19ba4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 39 additions and 3 deletions

View File

@ -22,9 +22,12 @@ class ConversationBottomPanelView: UIView {
let contentLayoutGuide = UILayoutGuide()
private var backgroundViewEffect: UIVisualEffect {
guard #available(iOS 26, *), useGlassPanel else {
if UIAccessibility.isReduceTransparencyEnabled {
return UIBlurEffect(style: .systemThinMaterial)
}
guard #available(iOS 26, *), useGlassPanel else {
return Theme.barBlurEffect
}
// Same as in ConversationInputToolbar.
let glassEffect = UIGlassEffect(style: .regular)
glassEffect.tintColor = .Signal.glassBackgroundTint
@ -123,6 +126,19 @@ class ConversationBottomPanelView: UIView {
constant: UIDevice.current.hasIPhoneXNotch ? 0 : -12,
),
])
// Alter the visual effect view's tint to match our background color
// so the bottom panel, when over a solid color background matching UIColor.Signal.background,
// exactly matches the background color. This is brittle, but there is no way to get
// this behavior from UIVisualEffectView otherwise.
if
!UIAccessibility.isReduceTransparencyEnabled,
let tintingView = backgroundView.subviews.first(where: {
String(describing: type(of: $0)) == "_UIVisualEffectSubview"
})
{
tintingView.backgroundColor = UIColor.Signal.background.withAlphaComponent(OWSNavigationBar.backgroundBlurMutingFactor)
}
}
}

View File

@ -473,13 +473,33 @@ class MessageRequestView: ConversationBottomPanelView {
// MARK: -
private func buttonConfiguration(title: String) -> UIButton.Configuration {
var configuration: UIButton.Configuration
if #available(iOS 26, *) {
configuration = .prominentGlass()
configuration.baseForegroundColor = .Signal.label
} else {
configuration = .plain()
configuration.baseForegroundColor = .Signal.accent
}
configuration.titleAlignment = .center
configuration.titleTextAttributesTransformer = .defaultFont(.dynamicTypeHeadlineClamped)
configuration.baseBackgroundColor = .clear
if #available(iOS 26, *) {
configuration.cornerStyle = .capsule
}
configuration.title = title
configuration.contentInsets = NSDirectionalEdgeInsets(hMargin: 12, vMargin: 8)
return configuration
}
private func prepareButton(
title: String,
destructive: Bool = false,
actionBlock: @escaping () -> Void,
) -> UIButton {
let button = UIButton(
configuration: .mediumSecondary(title: title),
configuration: buttonConfiguration(title: title),
primaryAction: UIAction { _ in
actionBlock()
},

View File

@ -5585,7 +5585,7 @@
"MESSAGE_REQUEST_VIEW_REMOVED_CONTACT_PROMPT_FORMAT" = "Let %@ message you and share your name and photo with them? You have removed this person in the past.";
/* incoming message request button text which reports a conversation as spam */
"MESSAGE_REQUEST_VIEW_REPORT_BUTTON" = "Report";
"MESSAGE_REQUEST_VIEW_REPORT_BUTTON" = "Report";
/* A button used to unlock a blocked conversation. */
"MESSAGE_REQUEST_VIEW_UNBLOCK_BUTTON" = "Unblock";