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.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
|
||||
if #available(iOS 13.0, *) {
|
||||
self.backgroundView.layer.cornerCurve = .continuous
|
||||
|
@ -1067,7 +1067,7 @@ final class DrawingTextLayoutManager: NSLayoutManager {
|
||||
var last = self.rectArray[index - 1]
|
||||
var cur = self.rectArray[index]
|
||||
|
||||
self.radius = cur.height * 0.18
|
||||
self.radius = cur.height * 0.2
|
||||
|
||||
let doubleRadius = self.radius * 2.5
|
||||
|
||||
@ -1134,7 +1134,7 @@ final class DrawingTextLayoutManager: NSLayoutManager {
|
||||
var last: CGRect = .null
|
||||
for i in 0 ..< self.rectArray.count {
|
||||
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))
|
||||
if i == 0 {
|
||||
|
@ -1069,7 +1069,7 @@ final class LocationPickerControllerNode: ViewControllerTracingNode, CLLocationM
|
||||
let actionsInset: CGFloat = 148.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))
|
||||
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) {
|
||||
|
@ -186,6 +186,9 @@ final class MediaEditorScreenComponent: Component {
|
||||
var playerStateDisposable: Disposable?
|
||||
var playerState: MediaEditorPlayerState?
|
||||
|
||||
var isPremium = false
|
||||
var isPremiumDisposable: Disposable?
|
||||
|
||||
init(context: AccountContext, mediaEditor: Signal<MediaEditor?, NoError>) {
|
||||
self.context = context
|
||||
|
||||
@ -205,10 +208,19 @@ final class MediaEditorScreenComponent: Component {
|
||||
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 {
|
||||
self.playerStateDisposable?.dispose()
|
||||
self.isPremiumDisposable?.dispose()
|
||||
}
|
||||
|
||||
var muteDidChange = false
|
||||
@ -1195,7 +1207,7 @@ final class MediaEditorScreenComponent: Component {
|
||||
timeoutSelected: timeoutSelected,
|
||||
displayGradient: false,
|
||||
bottomInset: 0.0,
|
||||
isFormattingLocked: false,
|
||||
isFormattingLocked: !state.isPremium,
|
||||
hideKeyboard: self.currentInputMode == .emoji,
|
||||
forceIsEditing: self.currentInputMode == .emoji,
|
||||
disabledPlaceholder: nil
|
||||
@ -2742,8 +2754,12 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate
|
||||
}
|
||||
|
||||
var location: CLLocationCoordinate2D?
|
||||
if let subject = self.subject, case let .asset(asset) = subject {
|
||||
location = asset.location?.coordinate
|
||||
if let subject = self.subject {
|
||||
if case let .asset(asset) = subject {
|
||||
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
|
||||
if let self {
|
||||
|
Loading…
x
Reference in New Issue
Block a user