TitlebarView: move to drag api
This commit is contained in:
@@ -31,7 +31,8 @@ class ResourcePolicyManager: NSObject, SBRResourceOriginPolicyDataSource
|
||||
func allowedOriginsForScriptResources() -> Set<String> { allowedOriginSet }
|
||||
|
||||
func scriptPolicyTypeByOrigin() -> [String : NSNumber] {
|
||||
return scriptPolicies.mapValues { NSNumber(integerLiteral: $0.rawValue) }
|
||||
let types = scriptPolicies.mapValues { NSNumber(integerLiteral: $0.rawValue) }
|
||||
return types
|
||||
}
|
||||
|
||||
private lazy var scriptPolicies: Dictionary<String, ScriptPolicy.PolicyType> = {
|
||||
|
||||
@@ -61,11 +61,7 @@ class TitlebarView: UIView
|
||||
|
||||
private let separatorView = UIView(frame: .zero)
|
||||
private let securityIndicatorView = SecurityIndicatorView()
|
||||
|
||||
override var _sceneDraggingBehaviorOnPan: _UIViewSceneDraggingBehaviorOnPan {
|
||||
_UIViewSceneDraggingBehaviorOnPan.dragScene
|
||||
}
|
||||
|
||||
|
||||
convenience init() {
|
||||
self.init(frame: .zero)
|
||||
addSubview(backgroundView)
|
||||
@@ -88,6 +84,11 @@ class TitlebarView: UIView
|
||||
securityIndicatorView.label.font = UIFont.systemFont(ofSize: 10.0)
|
||||
|
||||
backgroundView.alpha = 0.98
|
||||
|
||||
// Make draggable
|
||||
if #available(iOS 17.0, *) {
|
||||
addInteraction(UIWindowSceneDragInteraction())
|
||||
}
|
||||
}
|
||||
|
||||
func setTitle(_ title: String) {
|
||||
|
||||
Reference in New Issue
Block a user