mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various fixes
This commit is contained in:
parent
f57d8512cc
commit
934487fe00
@ -264,7 +264,7 @@ public final class DrawingLocationEntityView: DrawingEntityView, UITextViewDeleg
|
|||||||
self.iconView.image = generateIcon(style: self.locationEntity.style)
|
self.iconView.image = generateIcon(style: self.locationEntity.style)
|
||||||
}
|
}
|
||||||
|
|
||||||
self.backgroundView.layer.cornerRadius = self.textSize.height * 0.18
|
self.backgroundView.layer.cornerRadius = self.textSize.height * 0.2
|
||||||
self.blurredBackgroundView.layer.cornerRadius = self.backgroundView.layer.cornerRadius
|
self.blurredBackgroundView.layer.cornerRadius = self.backgroundView.layer.cornerRadius
|
||||||
if #available(iOS 13.0, *) {
|
if #available(iOS 13.0, *) {
|
||||||
self.backgroundView.layer.cornerCurve = .continuous
|
self.backgroundView.layer.cornerCurve = .continuous
|
||||||
|
@ -1067,7 +1067,7 @@ final class DrawingTextLayoutManager: NSLayoutManager {
|
|||||||
var last = self.rectArray[index - 1]
|
var last = self.rectArray[index - 1]
|
||||||
var cur = self.rectArray[index]
|
var cur = self.rectArray[index]
|
||||||
|
|
||||||
self.radius = cur.height * 0.18
|
self.radius = cur.height * 0.2
|
||||||
|
|
||||||
let doubleRadius = self.radius * 2.5
|
let doubleRadius = self.radius * 2.5
|
||||||
|
|
||||||
@ -1134,7 +1134,7 @@ final class DrawingTextLayoutManager: NSLayoutManager {
|
|||||||
var last: CGRect = .null
|
var last: CGRect = .null
|
||||||
for i in 0 ..< self.rectArray.count {
|
for i in 0 ..< self.rectArray.count {
|
||||||
let cur = self.rectArray[i]
|
let cur = self.rectArray[i]
|
||||||
self.radius = cur.height * 0.18
|
self.radius = cur.height * 0.2
|
||||||
|
|
||||||
path.append(UIBezierPath(roundedRect: cur, cornerRadius: self.radius))
|
path.append(UIBezierPath(roundedRect: cur, cornerRadius: self.radius))
|
||||||
if i == 0 {
|
if i == 0 {
|
||||||
|
@ -1069,7 +1069,7 @@ final class LocationPickerControllerNode: ViewControllerTracingNode, CLLocationM
|
|||||||
let actionsInset: CGFloat = 148.0
|
let actionsInset: CGFloat = 148.0
|
||||||
let padding: CGFloat = 16.0
|
let padding: CGFloat = 16.0
|
||||||
let emptyTextSize = self.emptyResultsTextNode.updateLayout(CGSize(width: layout.size.width - layout.safeInsets.left - layout.safeInsets.right - padding * 2.0, height: CGFloat.greatestFiniteMagnitude))
|
let emptyTextSize = self.emptyResultsTextNode.updateLayout(CGSize(width: layout.size.width - layout.safeInsets.left - layout.safeInsets.right - padding * 2.0, height: CGFloat.greatestFiniteMagnitude))
|
||||||
transition.updateFrame(node: self.emptyResultsTextNode, frame: CGRect(origin: CGPoint(x: floor((layout.size.width - emptyTextSize.width) / 2.0), y: headerHeight + actionsInset + floor((layout.size.height - headerHeight - actionsInset - emptyTextSize.height - layout.intrinsicInsets.bottom) / 2.0)), size: emptyTextSize))
|
transition.updateFrame(node: self.emptyResultsTextNode, frame: CGRect(origin: CGPoint(x: floor((layout.size.width - emptyTextSize.width) / 2.0), y: headerHeight + actionsInset + floor((layout.size.height - headerHeight - actionsInset - emptyTextSize.height - layout.intrinsicInsets.bottom - layout.additionalInsets.bottom) / 2.0)), size: emptyTextSize))
|
||||||
}
|
}
|
||||||
|
|
||||||
func containerLayoutUpdated(_ layout: ContainerViewLayout, navigationHeight: CGFloat, transition: ContainedViewLayoutTransition) {
|
func containerLayoutUpdated(_ layout: ContainerViewLayout, navigationHeight: CGFloat, transition: ContainedViewLayoutTransition) {
|
||||||
|
@ -186,6 +186,9 @@ final class MediaEditorScreenComponent: Component {
|
|||||||
var playerStateDisposable: Disposable?
|
var playerStateDisposable: Disposable?
|
||||||
var playerState: MediaEditorPlayerState?
|
var playerState: MediaEditorPlayerState?
|
||||||
|
|
||||||
|
var isPremium = false
|
||||||
|
var isPremiumDisposable: Disposable?
|
||||||
|
|
||||||
init(context: AccountContext, mediaEditor: Signal<MediaEditor?, NoError>) {
|
init(context: AccountContext, mediaEditor: Signal<MediaEditor?, NoError>) {
|
||||||
self.context = context
|
self.context = context
|
||||||
|
|
||||||
@ -205,10 +208,19 @@ final class MediaEditorScreenComponent: Component {
|
|||||||
self.updated()
|
self.updated()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
self.isPremiumDisposable = (context.engine.data.subscribe(TelegramEngine.EngineData.Item.Peer.Peer(id: context.account.peerId))
|
||||||
|
|> deliverOnMainQueue).start(next: { [weak self] peer in
|
||||||
|
if let self {
|
||||||
|
self.isPremium = peer?.isPremium ?? false
|
||||||
|
self.updated()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
self.playerStateDisposable?.dispose()
|
self.playerStateDisposable?.dispose()
|
||||||
|
self.isPremiumDisposable?.dispose()
|
||||||
}
|
}
|
||||||
|
|
||||||
var muteDidChange = false
|
var muteDidChange = false
|
||||||
@ -1195,7 +1207,7 @@ final class MediaEditorScreenComponent: Component {
|
|||||||
timeoutSelected: timeoutSelected,
|
timeoutSelected: timeoutSelected,
|
||||||
displayGradient: false,
|
displayGradient: false,
|
||||||
bottomInset: 0.0,
|
bottomInset: 0.0,
|
||||||
isFormattingLocked: false,
|
isFormattingLocked: !state.isPremium,
|
||||||
hideKeyboard: self.currentInputMode == .emoji,
|
hideKeyboard: self.currentInputMode == .emoji,
|
||||||
forceIsEditing: self.currentInputMode == .emoji,
|
forceIsEditing: self.currentInputMode == .emoji,
|
||||||
disabledPlaceholder: nil
|
disabledPlaceholder: nil
|
||||||
@ -2742,8 +2754,12 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate
|
|||||||
}
|
}
|
||||||
|
|
||||||
var location: CLLocationCoordinate2D?
|
var location: CLLocationCoordinate2D?
|
||||||
if let subject = self.subject, case let .asset(asset) = subject {
|
if let subject = self.subject {
|
||||||
|
if case let .asset(asset) = subject {
|
||||||
location = asset.location?.coordinate
|
location = asset.location?.coordinate
|
||||||
|
} else if case let .draft(draft, _) = subject {
|
||||||
|
location = draft.location
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let locationController = storyLocationPickerController(context: self.context, location: location, completion: { [weak self] location, queryId, resultId, address, countryCode in
|
let locationController = storyLocationPickerController(context: self.context, location: location, completion: { [weak self] location, queryId, resultId, address, countryCode in
|
||||||
if let self {
|
if let self {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user