Update context menu background handling

This commit is contained in:
Elaine 2025-10-28 13:50:26 -04:00 committed by GitHub
parent 398a244d50
commit 5be9a2cbc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -71,6 +71,8 @@ class MessageReactionPicker: UIStackView {
false
}
var backgroundContentView: UIView?
switch (style, liquidGlassIsAvailable) {
case (.inline, _):
break
@ -85,6 +87,7 @@ class MessageReactionPicker: UIStackView {
}
addBackgroundView(visualEffectView)
backgroundView = visualEffectView
backgroundContentView = visualEffectView.contentView
#else
fallthrough
#endif
@ -107,6 +110,7 @@ class MessageReactionPicker: UIStackView {
shadowView.layer.shadowOffset = CGSize(width: 0, height: 4)
backgroundView?.addSubview(shadowView)
shadowView.autoPinEdgesToSuperviewEdges()
backgroundContentView = backgroundView
}
autoSetDimension(.height, toSize: pickerDiameter)
@ -164,7 +168,7 @@ class MessageReactionPicker: UIStackView {
selectedBackgroundView.backgroundColor = Theme.isDarkThemeEnabled || forceDarkTheme ? .ows_gray60 : .ows_gray05
selectedBackgroundView.clipsToBounds = true
selectedBackgroundView.layer.cornerRadius = selectedBackgroundHeight / 2
backgroundView?.addSubview(selectedBackgroundView)
backgroundContentView?.addSubview(selectedBackgroundView)
selectedBackgroundView.autoSetDimensions(to: CGSize(square: selectedBackgroundHeight))
selectedBackgroundView.autoAlignAxis(.horizontal, toSameAxisOf: button)
selectedBackgroundView.autoAlignAxis(.vertical, toSameAxisOf: button)