From b789a19ba4529b02cfc802df3873ccb0f89e9aa9 Mon Sep 17 00:00:00 2001 From: kate-signal Date: Fri, 15 May 2026 13:24:01 -0400 Subject: [PATCH] adjust message request buttons styling --- .../ConversationBottomPanelView.swift | 18 ++++++++++++++- .../ConversationView/MessageRequestView.swift | 22 ++++++++++++++++++- .../translations/en.lproj/Localizable.strings | 2 +- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/Signal/ConversationView/ConversationBottomPanelView.swift b/Signal/ConversationView/ConversationBottomPanelView.swift index f2d382d427..16b925f3a8 100644 --- a/Signal/ConversationView/ConversationBottomPanelView.swift +++ b/Signal/ConversationView/ConversationBottomPanelView.swift @@ -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) + } } } diff --git a/Signal/ConversationView/MessageRequestView.swift b/Signal/ConversationView/MessageRequestView.swift index efce550ebb..f538d5035f 100644 --- a/Signal/ConversationView/MessageRequestView.swift +++ b/Signal/ConversationView/MessageRequestView.swift @@ -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() }, diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index 96a8d307f4..d1092f99a3 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -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";