mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-11 08:50:24 +00:00
no message
This commit is contained in:
parent
139fb8fc7c
commit
cad4955b71
@ -7,7 +7,7 @@
|
|||||||
<key>Display.xcscheme</key>
|
<key>Display.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>7</integer>
|
<integer>5</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>DisplayMac.xcscheme</key>
|
<key>DisplayMac.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
@ -17,7 +17,7 @@
|
|||||||
<key>DisplayTests.xcscheme</key>
|
<key>DisplayTests.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>9</integer>
|
<integer>7</integer>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
<key>SuppressBuildableAutocreation</key>
|
<key>SuppressBuildableAutocreation</key>
|
||||||
|
|||||||
@ -62,7 +62,7 @@ final class ContextMenuContainerNode: ASDisplayNode {
|
|||||||
let arrowOnBottom = maskParams.arrowOnBottom
|
let arrowOnBottom = maskParams.arrowOnBottom
|
||||||
|
|
||||||
path.move(to: CGPoint(x: 0.0, y: verticalInset + cornerRadius))
|
path.move(to: CGPoint(x: 0.0, y: verticalInset + cornerRadius))
|
||||||
path.addArc(withCenter: CGPoint(x: cornerRadius, y: verticalInset + cornerRadius), radius: cornerRadius, startAngle: CGFloat(M_PI), endAngle: CGFloat(3 * M_PI / 2), clockwise: true)
|
path.addArc(withCenter: CGPoint(x: cornerRadius, y: verticalInset + cornerRadius), radius: cornerRadius, startAngle: CGFloat.pi, endAngle: CGFloat(3 * M_PI / 2), clockwise: true)
|
||||||
if !arrowOnBottom {
|
if !arrowOnBottom {
|
||||||
path.addLine(to: CGPoint(x: arrowPosition - arrowWidth / 2.0, y: verticalInset))
|
path.addLine(to: CGPoint(x: arrowPosition - arrowWidth / 2.0, y: verticalInset))
|
||||||
path.addLine(to: CGPoint(x: arrowPosition, y: 0.0))
|
path.addLine(to: CGPoint(x: arrowPosition, y: 0.0))
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public final class ImmediateTextNode: TextNode {
|
public class ImmediateTextNode: TextNode {
|
||||||
public var attributedText: NSAttributedString?
|
public var attributedText: NSAttributedString?
|
||||||
public var textAlignment: NSTextAlignment = .natural
|
public var textAlignment: NSTextAlignment = .natural
|
||||||
public var maximumNumberOfLines: Int = 1
|
public var maximumNumberOfLines: Int = 1
|
||||||
|
|||||||
@ -164,7 +164,7 @@ public final class PeekControllerGestureRecognizer: UIPanGestureRecognizer {
|
|||||||
override public func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent) {
|
override public func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent) {
|
||||||
super.touchesEnded(touches, with: event)
|
super.touchesEnded(touches, with: event)
|
||||||
|
|
||||||
if self.activateBySingleTap, candidateContent != nil {
|
if self.activateBySingleTap, self.candidateContent != nil, self.presentedController == nil {
|
||||||
self.longTapTimerFired()
|
self.longTapTimerFired()
|
||||||
self.pressTimerFired()
|
self.pressTimerFired()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -118,9 +118,9 @@ final class PeekControllerNode: ViewControllerTracingNode {
|
|||||||
var containerFrame: CGRect
|
var containerFrame: CGRect
|
||||||
switch self.content.presentation() {
|
switch self.content.presentation() {
|
||||||
case .contained:
|
case .contained:
|
||||||
containerFrame = CGRect(origin: CGPoint(x: floor((layout.size.width - contentSize.width) / 2.0), y: self.containerOffset + floor((layout.size.height - contentSize.height) / 2.0)), size: contentSize)
|
containerFrame = CGRect(origin: CGPoint(x: floor((layout.size.width - contentSize.width) / 2.0), y: floor((layout.size.height - contentSize.height) / 2.0)), size: contentSize)
|
||||||
case .freeform:
|
case .freeform:
|
||||||
containerFrame = CGRect(origin: CGPoint(x: floor((layout.size.width - contentSize.width) / 2.0), y: self.containerOffset + floor((layout.size.height - contentSize.height) / 4.0)), size: contentSize)
|
containerFrame = CGRect(origin: CGPoint(x: floor((layout.size.width - contentSize.width) / 2.0), y: floor((layout.size.height - contentSize.height) / 4.0)), size: contentSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
if let menuNode = self.menuNode {
|
if let menuNode = self.menuNode {
|
||||||
@ -131,17 +131,23 @@ final class PeekControllerNode: ViewControllerTracingNode {
|
|||||||
if self.displayingMenu {
|
if self.displayingMenu {
|
||||||
let upperBound = layout.size.height - layoutInsets.bottom - menuHeight - 14.0 * 2.0 - containerFrame.height
|
let upperBound = layout.size.height - layoutInsets.bottom - menuHeight - 14.0 * 2.0 - containerFrame.height
|
||||||
if containerFrame.origin.y > upperBound {
|
if containerFrame.origin.y > upperBound {
|
||||||
var offset = upperBound - containerFrame.origin.y
|
containerFrame.origin.y = upperBound
|
||||||
let delta = abs(offset)
|
|
||||||
let factor: CGFloat = 60.0
|
|
||||||
offset = (-((1.0 - (1.0 / (((delta) * 0.55 / (factor)) + 1.0))) * factor)) * (offset < 0.0 ? 1.0 : -1.0)
|
|
||||||
containerFrame.origin.y = upperBound - offset
|
|
||||||
}
|
}
|
||||||
|
|
||||||
transition.updateAlpha(layer: self.blurView.layer, alpha: 1.0)
|
transition.updateAlpha(layer: self.blurView.layer, alpha: 1.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.displayingMenu {
|
||||||
|
var offset = self.containerOffset
|
||||||
|
let delta = abs(offset)
|
||||||
|
let factor: CGFloat = 60.0
|
||||||
|
offset = (-((1.0 - (1.0 / (((delta) * 0.55 / (factor)) + 1.0))) * factor)) * (offset < 0.0 ? 1.0 : -1.0)
|
||||||
|
containerFrame = containerFrame.offsetBy(dx: 0.0, dy: offset)
|
||||||
|
} else {
|
||||||
|
containerFrame = containerFrame.offsetBy(dx: 0.0, dy: self.containerOffset)
|
||||||
|
}
|
||||||
|
|
||||||
transition.updateFrame(node: self.containerNode, frame: containerFrame)
|
transition.updateFrame(node: self.containerNode, frame: containerFrame)
|
||||||
|
|
||||||
if let menuNode = self.menuNode, let menuSize = menuSize {
|
if let menuNode = self.menuNode, let menuSize = menuSize {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user