mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 11:23:48 +00:00
Fix context menu appearance when system theme does not match the app's theme
This commit is contained in:
parent
c3a0cf78c0
commit
acf59258e0
@ -39,6 +39,7 @@ private enum ContextItemNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final class ContextActionsContainerNode: ASDisplayNode {
|
final class ContextActionsContainerNode: ASDisplayNode {
|
||||||
|
private let theme: PresentationTheme
|
||||||
private var effectView: UIVisualEffectView?
|
private var effectView: UIVisualEffectView?
|
||||||
private var itemNodes: [ContextItemNode]
|
private var itemNodes: [ContextItemNode]
|
||||||
private let feedbackTap: () -> Void
|
private let feedbackTap: () -> Void
|
||||||
@ -47,6 +48,7 @@ final class ContextActionsContainerNode: ASDisplayNode {
|
|||||||
private var currentHighlightedActionNode: ContextActionNode?
|
private var currentHighlightedActionNode: ContextActionNode?
|
||||||
|
|
||||||
init(theme: PresentationTheme, items: [ContextMenuItem], getController: @escaping () -> ContextController?, actionSelected: @escaping (ContextMenuActionResult) -> Void, feedbackTap: @escaping () -> Void) {
|
init(theme: PresentationTheme, items: [ContextMenuItem], getController: @escaping () -> ContextController?, actionSelected: @escaping (ContextMenuActionResult) -> Void, feedbackTap: @escaping () -> Void) {
|
||||||
|
self.theme = theme
|
||||||
self.feedbackTap = feedbackTap
|
self.feedbackTap = feedbackTap
|
||||||
|
|
||||||
var itemNodes: [ContextItemNode] = []
|
var itemNodes: [ContextItemNode] = []
|
||||||
@ -130,7 +132,13 @@ final class ContextActionsContainerNode: ASDisplayNode {
|
|||||||
case .regular:
|
case .regular:
|
||||||
if self.effectView == nil {
|
if self.effectView == nil {
|
||||||
let effectView: UIVisualEffectView
|
let effectView: UIVisualEffectView
|
||||||
if #available(iOS 10.0, *) {
|
if #available(iOS 13.0, *) {
|
||||||
|
if self.theme.overallDarkAppearance {
|
||||||
|
effectView = UIVisualEffectView(effect: UIBlurEffect(style: .systemMaterialDark))
|
||||||
|
} else {
|
||||||
|
effectView = UIVisualEffectView(effect: UIBlurEffect(style: .systemMaterialLight))
|
||||||
|
}
|
||||||
|
} else if #available(iOS 10.0, *) {
|
||||||
effectView = UIVisualEffectView(effect: UIBlurEffect(style: .regular))
|
effectView = UIVisualEffectView(effect: UIBlurEffect(style: .regular))
|
||||||
} else {
|
} else {
|
||||||
effectView = UIVisualEffectView(effect: UIBlurEffect(style: .light))
|
effectView = UIVisualEffectView(effect: UIBlurEffect(style: .light))
|
||||||
|
@ -520,7 +520,6 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
|
|||||||
self.effectView.effect = makeCustomZoomBlurEffect()
|
self.effectView.effect = makeCustomZoomBlurEffect()
|
||||||
self.effectView.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2 * animationDurationFactor)
|
self.effectView.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2 * animationDurationFactor)
|
||||||
self.propertyAnimator = UIViewPropertyAnimator(duration: 0.2 * animationDurationFactor * UIView.animationDurationFactor(), curve: .easeInOut, animations: { [weak self] in
|
self.propertyAnimator = UIViewPropertyAnimator(duration: 0.2 * animationDurationFactor * UIView.animationDurationFactor(), curve: .easeInOut, animations: { [weak self] in
|
||||||
//self?.effectView.effect = makeCustomZoomBlurEffect()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user