Various Fixes

This commit is contained in:
Ilya Laktyushin 2021-06-18 20:13:38 +03:00
parent 2ceed9ddde
commit 85e0906828
4 changed files with 12 additions and 5 deletions

View File

@ -632,8 +632,8 @@ final class ImportStickerPackControllerNode: ViewControllerTracingNode, UIScroll
firstItem = StickerPackItem(index: ItemCollectionItemIndex(index: 0, id: 0), file: TelegramMediaFile(fileId: MediaId(namespace: 0, id: 0), partialReference: nil, resource: resource, previewRepresentations: [], videoThumbnails: [], immediateThumbnailData: nil, mimeType: stickerPack.isAnimated ? "application/x-tgsticker": "image/png", size: nil, attributes: [.FileName(fileName: stickerPack.isAnimated ? "sticker.tgs" : "sticker.png"), .ImageSize(size: firstStickerItem.dimensions)]), indexKeys: [])
}
strongSelf.presentInGlobalOverlay?(UndoOverlayController(presentationData: strongSelf.presentationData, content: .stickersModified(title: strongSelf.presentationData.strings.StickerPackActionInfo_AddedTitle, text: strongSelf.presentationData.strings.StickerPackActionInfo_AddedText(info.title).0, undo: false, info: info, topItem: firstItem ?? items.first, context: strongSelf.context), elevatedLayout: false, action: { _ in
(navigationController?.viewControllers.last as? ViewController)?.present(StickerPackScreen(context: context, mode: .settings, mainStickerPack: .id(id: info.id.id, accessHash: info.accessHash), stickerPacks: [], parentNavigationController: navigationController, actionPerformed: { _, _, _ in
}), in: .window(.root))
// (navigationController?.viewControllers.last as? ViewController)?.present(StickerPackScreen(context: context, mode: .settings, mainStickerPack: .id(id: info.id.id, accessHash: info.accessHash), stickerPacks: [], parentNavigationController: navigationController, actionPerformed: { _, _, _ in
// }), in: .window(.root))
return true
}), nil)
strongSelf.cancel?()

View File

@ -195,12 +195,12 @@ private class TextField: UITextField, UIScrollViewDelegate {
let textRect = self.textRect(forBounds: bounds)
let labelSize = self.placeholderLabel.updateLayout(textRect.size)
self.placeholderLabel.frame = CGRect(origin: CGPoint(x: textRect.minX, y: floorToScreenPixels((bounds.height - labelSize.height) / 2.0)), size: labelSize)
self.placeholderLabel.frame = CGRect(origin: CGPoint(x: textRect.minX + 3.0, y: floorToScreenPixels((bounds.height - labelSize.height) / 2.0)), size: labelSize)
let prefixSize = self.prefixLabel.updateLayout(CGSize(width: floor(bounds.size.width * 0.7), height: bounds.size.height))
let prefixBounds = bounds.insetBy(dx: 4.0, dy: 4.0)
self.prefixLabel.frame = CGRect(origin: CGPoint(x: prefixBounds.minX, y: floorToScreenPixels((bounds.height - prefixSize.height) / 2.0)), size: prefixSize)
self.updatePrefixWidth(prefixSize.width)
self.updatePrefixWidth(prefixSize.width + 3.0)
}
}

View File

@ -19,6 +19,7 @@ final class GroupVideoNode: ASDisplayNode {
case fillOrFitToSquare
case fillHorizontal
case fillVertical
case fit
}
let sourceContainerNode: PinchSourceContainerNode
@ -252,6 +253,8 @@ final class GroupVideoNode: ASDisplayNode {
let filledToSquareSize = rotatedVideoSize.aspectFilled(CGSize(width: squareSide, height: squareSide))
switch layoutMode {
case .fit:
rotatedVideoSize = fittedSize
case .fillOrFitToSquare:
rotatedVideoSize = filledToSquareSize
case .fillHorizontal:

View File

@ -1098,7 +1098,11 @@ final class VoiceChatMainStageNode: ASDisplayNode {
layoutMode = .fillOrFitToSquare
bottomInset = 0.0
} else {
layoutMode = isLandscape ? .fillHorizontal : .fillVertical
if let (_, _, _, isPresentation, _) = self.currentPeer, isPresentation {
layoutMode = .fit
} else {
layoutMode = isLandscape ? .fillHorizontal : .fillVertical
}
}
if let currentVideoNode = self.currentVideoNode {