Various improvements

This commit is contained in:
Isaac
2024-02-06 01:04:15 +04:00
parent 9006b615e6
commit 3ce47cc05a
5 changed files with 29 additions and 8 deletions

View File

@@ -13,6 +13,7 @@ import EntityKeyboard
import AnimationCache
import MultiAnimationRenderer
import UndoUI
import UIKitRuntimeUtils
private let animationDurationFactor: Double = 1.0
@@ -559,6 +560,10 @@ final class ContextControllerNode: ViewControllerTracingNode, UIScrollViewDelega
self?.dimNodeTapped()
return true
}
if controller.disableScreenshots {
setLayerDisableScreenshots(self.layer, true)
}
}
deinit {
@@ -2426,6 +2431,7 @@ public final class ContextController: ViewController, StandalonePresentableContr
public var useComplexItemsTransitionAnimation = false
public var immediateItemsTransitionAnimation = false
let workaroundUseLegacyImplementation: Bool
let disableScreenshots: Bool
public enum HandledTouchEvent {
case ignore
@@ -2441,7 +2447,7 @@ public final class ContextController: ViewController, StandalonePresentableContr
public var getOverlayViews: (() -> [UIView])?
convenience public init(presentationData: PresentationData, source: ContextContentSource, items: Signal<ContextController.Items, NoError>, recognizer: TapLongTapOrDoubleTapGestureRecognizer? = nil, gesture: ContextGesture? = nil, workaroundUseLegacyImplementation: Bool = false) {
convenience public init(presentationData: PresentationData, source: ContextContentSource, items: Signal<ContextController.Items, NoError>, recognizer: TapLongTapOrDoubleTapGestureRecognizer? = nil, gesture: ContextGesture? = nil, workaroundUseLegacyImplementation: Bool = false, disableScreenshots: Bool = false) {
self.init(
presentationData: presentationData,
configuration: ContextController.Configuration(
@@ -2455,7 +2461,8 @@ public final class ContextController: ViewController, StandalonePresentableContr
),
recognizer: recognizer,
gesture: gesture,
workaroundUseLegacyImplementation: workaroundUseLegacyImplementation
workaroundUseLegacyImplementation: workaroundUseLegacyImplementation,
disableScreenshots: disableScreenshots
)
}
@@ -2464,13 +2471,15 @@ public final class ContextController: ViewController, StandalonePresentableContr
configuration: ContextController.Configuration,
recognizer: TapLongTapOrDoubleTapGestureRecognizer? = nil,
gesture: ContextGesture? = nil,
workaroundUseLegacyImplementation: Bool = false
workaroundUseLegacyImplementation: Bool = false,
disableScreenshots: Bool = false
) {
self.presentationData = presentationData
self.configuration = configuration
self.recognizer = recognizer
self.gesture = gesture
self.workaroundUseLegacyImplementation = workaroundUseLegacyImplementation
self.disableScreenshots = disableScreenshots
super.init(navigationBarPresentationData: nil)