From a7eb78f46ca66784f51b1a6f85dc792b0425a75c Mon Sep 17 00:00:00 2001 From: Igor Solomennikov Date: Thu, 21 May 2026 11:19:01 -0700 Subject: [PATCH] Enable `isPointerInteractionEnabled` on some glass buttons. Round buttons in chat input bar and media viewer. With this property enabled iPadOS will highlight the button what trackpad cursor is over it. --- Signal/ConversationView/ConversationInputToolbar.swift | 9 +++++++++ .../Context View/StoryContextOnboardingOverlayView.swift | 1 + .../Context View/StoryContextViewController.swift | 2 ++ .../Replies & Views Sheets/StoryReplyInputToolbar.swift | 1 + 4 files changed, 13 insertions(+) diff --git a/Signal/ConversationView/ConversationInputToolbar.swift b/Signal/ConversationView/ConversationInputToolbar.swift index 9d4b54308e..505f1f69ce 100644 --- a/Signal/ConversationView/ConversationInputToolbar.swift +++ b/Signal/ConversationView/ConversationInputToolbar.swift @@ -249,6 +249,7 @@ public class ConversationInputToolbar: UIView, QuotedReplyPreviewDelegate { button.configuration?.baseForegroundColor = Style.buttonTintColor button.accessibilityLabel = accessibilityLabel button.accessibilityIdentifier = accessibilityIdentifier + button.isPointerInteractionEnabled = true button.translatesAutoresizingMaskIntoConstraints = false button.addConstraints([ button.widthAnchor.constraint(equalToConstant: LayoutMetrics.initialTextBoxHeight), @@ -345,6 +346,7 @@ public class ConversationInputToolbar: UIView, QuotedReplyPreviewDelegate { button.configuration?.cornerStyle = .capsule button.accessibilityLabel = MessageStrings.sendButton button.accessibilityIdentifier = accessibilityIdentifier + button.isPointerInteractionEnabled = true button.translatesAutoresizingMaskIntoConstraints = false button.addConstraints([ button.widthAnchor.constraint(equalToConstant: buttonSize), @@ -378,6 +380,7 @@ public class ConversationInputToolbar: UIView, QuotedReplyPreviewDelegate { comment: "Accessibility hint describing what you can do with the attachment button", ) button.accessibilityIdentifier = accessibilityIdentifier + button.isPointerInteractionEnabled = true button.translatesAutoresizingMaskIntoConstraints = false button.addConstraints([ button.widthAnchor.constraint(equalToConstant: buttonSize), @@ -403,6 +406,7 @@ public class ConversationInputToolbar: UIView, QuotedReplyPreviewDelegate { button.configuration?.baseForegroundColor = .white button.configuration?.cornerStyle = .capsule button.accessibilityIdentifier = accessibilityIdentifier + button.isPointerInteractionEnabled = true button.translatesAutoresizingMaskIntoConstraints = false button.addConstraints([ button.widthAnchor.constraint(equalToConstant: buttonSize), @@ -1216,6 +1220,7 @@ public class ConversationInputToolbar: UIView, QuotedReplyPreviewDelegate { let button = UIButton(type: .system) button.accessibilityLabel = MessageStrings.sendButton button.ows_adjustsImageWhenDisabled = true + button.isPointerInteractionEnabled = true button.accessibilityIdentifier = UIView.accessibilityIdentifier(in: self, name: "sendButton") button.setImage(UIImage(imageLiteralResourceName: "send-blue-28"), for: .normal) button.bounds.size = CGSize(width: 48, height: LayoutMetrics.initialToolbarHeight) @@ -1225,6 +1230,7 @@ public class ConversationInputToolbar: UIView, QuotedReplyPreviewDelegate { lazy var cameraButton: UIButton = { let button = UIButton(type: .system) button.tintColor = Style.buttonTintColor + button.isPointerInteractionEnabled = true button.accessibilityLabel = OWSLocalizedString( "CAMERA_BUTTON_LABEL", comment: "Accessibility label for camera button.", @@ -1242,6 +1248,7 @@ public class ConversationInputToolbar: UIView, QuotedReplyPreviewDelegate { lazy var voiceMemoButton: UIButton = { let button = UIButton(type: .system) button.tintColor = Style.buttonTintColor + button.isPointerInteractionEnabled = true button.accessibilityLabel = OWSLocalizedString( "INPUT_TOOLBAR_VOICE_MEMO_BUTTON_ACCESSIBILITY_LABEL", comment: "accessibility label for the button which records voice memos", @@ -1367,6 +1374,8 @@ public class ConversationInputToolbar: UIView, QuotedReplyPreviewDelegate { override private init(frame: CGRect) { super.init(frame: frame) + isPointerInteractionEnabled = true + addSubview(roundedCornersBackground) roundedCornersBackground.autoCenterInSuperview() roundedCornersBackground.autoSetDimensions(to: CGSize(square: 28)) diff --git a/Signal/src/ViewControllers/HomeView/Stories/Context View/StoryContextOnboardingOverlayView.swift b/Signal/src/ViewControllers/HomeView/Stories/Context View/StoryContextOnboardingOverlayView.swift index 10f60a8f24..27f93dcf9d 100644 --- a/Signal/src/ViewControllers/HomeView/Stories/Context View/StoryContextOnboardingOverlayView.swift +++ b/Signal/src/ViewControllers/HomeView/Stories/Context View/StoryContextOnboardingOverlayView.swift @@ -194,6 +194,7 @@ class StoryContextOnboardingOverlayView: UIView { self.delegate?.storyContextOnboardingOverlayWantsToExitStoryViewer(self) }, ) + closeButton.isPointerInteractionEnabled = true closeButton.translatesAutoresizingMaskIntoConstraints = false blurView.contentView.addSubview(closeButton) diff --git a/Signal/src/ViewControllers/HomeView/Stories/Context View/StoryContextViewController.swift b/Signal/src/ViewControllers/HomeView/Stories/Context View/StoryContextViewController.swift index 21cbdf92af..2ae7b82a15 100644 --- a/Signal/src/ViewControllers/HomeView/Stories/Context View/StoryContextViewController.swift +++ b/Signal/src/ViewControllers/HomeView/Stories/Context View/StoryContextViewController.swift @@ -297,6 +297,7 @@ class StoryContextViewController: OWSViewController, DatabaseChangeDelegate, spinner.autoCenterInSuperview() spinner.startAnimating() + closeButton.isPointerInteractionEnabled = true view.addSubview(closeButton) closeButton.translatesAutoresizingMaskIntoConstraints = false if #available(iOS 26, *) { @@ -462,6 +463,7 @@ class StoryContextViewController: OWSViewController, DatabaseChangeDelegate, ) } contextButton.setActions(actions: actions) + contextButton.isPointerInteractionEnabled = true return contextButton }() diff --git a/Signal/src/ViewControllers/HomeView/Stories/Replies & Views Sheets/StoryReplyInputToolbar.swift b/Signal/src/ViewControllers/HomeView/Stories/Replies & Views Sheets/StoryReplyInputToolbar.swift index baebac5399..b1d859af08 100644 --- a/Signal/src/ViewControllers/HomeView/Stories/Replies & Views Sheets/StoryReplyInputToolbar.swift +++ b/Signal/src/ViewControllers/HomeView/Stories/Replies & Views Sheets/StoryReplyInputToolbar.swift @@ -303,6 +303,7 @@ class StoryReplyInputToolbar: UIView, BodyRangesTextViewDelegate { directionalLayoutMargins.trailing -= SendButtonWrapper.legacySendButtonInnerHMargin } + sendButton.isPointerInteractionEnabled = true sendButton.setContentHuggingHorizontalHigh() sendButton.setCompressionResistanceHorizontalHigh() addSubview(sendButton)