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
a9289f03e4
commit
5b3de872f5
@ -125,7 +125,7 @@ private func mappedInsertEntries(context: AccountContext, presentationData: Item
|
|||||||
case let .groupCall(peer, _, isActive):
|
case let .groupCall(peer, _, isActive):
|
||||||
return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: CallListGroupCallItem(presentationData: presentationData, context: context, style: showSettings ? .blocks : .plain, peer: peer, isActive: isActive, editing: false, interaction: nodeInteraction), directionHint: entry.directionHint)
|
return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: CallListGroupCallItem(presentationData: presentationData, context: context, style: showSettings ? .blocks : .plain, peer: peer, isActive: isActive, editing: false, interaction: nodeInteraction), directionHint: entry.directionHint)
|
||||||
case let .messageEntry(topMessage, messages, _, _, dateTimeFormat, editing, hasActiveRevealControls, displayHeader, _):
|
case let .messageEntry(topMessage, messages, _, _, dateTimeFormat, editing, hasActiveRevealControls, displayHeader, _):
|
||||||
return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: CallListCallItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, context: context, style: showSettings ? .blocks : .plain, topMessage: topMessage, messages: messages, editing: editing, revealed: hasActiveRevealControls, displayHeader: displayHeader, interaction: nodeInteraction), directionHint: entry.directionHint)
|
return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: CallListCallItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, context: context, style: showSettings ? .blocks : .plain, topMessage: topMessage, messages: messages, editing: editing, revealed: hasActiveRevealControls, displayHeader: displayHeader, interaction: nodeInteraction), directionHint: entry.directionHint)
|
||||||
case let .holeEntry(_, theme):
|
case let .holeEntry(_, theme):
|
||||||
return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: CallListHoleItem(theme: theme), directionHint: entry.directionHint)
|
return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: CallListHoleItem(theme: theme), directionHint: entry.directionHint)
|
||||||
}
|
}
|
||||||
@ -876,7 +876,12 @@ final class CallListControllerNode: ASDisplayNode {
|
|||||||
var insets = layout.insets(options: [.input])
|
var insets = layout.insets(options: [.input])
|
||||||
insets.top += max(navigationBarHeight, layout.insets(options: [.statusBar]).top)
|
insets.top += max(navigationBarHeight, layout.insets(options: [.statusBar]).top)
|
||||||
|
|
||||||
let inset = max(16.0, floor((layout.size.width - 674.0) / 2.0))
|
let inset: CGFloat
|
||||||
|
if layout.size.width >= 375.0 {
|
||||||
|
inset = max(16.0, floor((layout.size.width - 674.0) / 2.0))
|
||||||
|
} else {
|
||||||
|
inset = 0.0
|
||||||
|
}
|
||||||
if case .navigation = self.mode {
|
if case .navigation = self.mode {
|
||||||
insets.left += inset
|
insets.left += inset
|
||||||
insets.right += inset
|
insets.right += inset
|
||||||
|
@ -473,8 +473,10 @@ open class ItemListControllerNode: ASDisplayNode {
|
|||||||
|
|
||||||
var addedInsets: UIEdgeInsets?
|
var addedInsets: UIEdgeInsets?
|
||||||
let inset = max(16.0, floor((layout.size.width - 674.0) / 2.0))
|
let inset = max(16.0, floor((layout.size.width - 674.0) / 2.0))
|
||||||
insets.left += inset
|
if layout.size.width >= 375.0 {
|
||||||
insets.right += inset
|
insets.left += inset
|
||||||
|
insets.right += inset
|
||||||
|
}
|
||||||
addedInsets = UIEdgeInsets(top: 0.0, left: inset, bottom: 0.0, right: inset)
|
addedInsets = UIEdgeInsets(top: 0.0, left: inset, bottom: 0.0, right: inset)
|
||||||
|
|
||||||
if self.rightOverlayNode.supernode == nil {
|
if self.rightOverlayNode.supernode == nil {
|
||||||
|
@ -148,7 +148,7 @@ public func itemListNeighborsGroupedInsets(_ neighbors: ItemListNeighbors) -> UI
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func itemListHasRoundedBlockLayout(_ params: ListViewItemLayoutParams) -> Bool {
|
public func itemListHasRoundedBlockLayout(_ params: ListViewItemLayoutParams) -> Bool {
|
||||||
return true
|
return params.width >= 375.0
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class ItemListPresentationData: Equatable {
|
public final class ItemListPresentationData: Equatable {
|
||||||
|
@ -6343,7 +6343,12 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
|||||||
|
|
||||||
var contentHeight: CGFloat = 0.0
|
var contentHeight: CGFloat = 0.0
|
||||||
|
|
||||||
let sectionInset = max(16.0, floor((layout.size.width - 674.0) / 2.0))
|
let sectionInset: CGFloat
|
||||||
|
if layout.size.width >= 375.0 {
|
||||||
|
sectionInset = max(16.0, floor((layout.size.width - 674.0) / 2.0))
|
||||||
|
} else {
|
||||||
|
sectionInset = 0.0
|
||||||
|
}
|
||||||
let headerInset: CGFloat
|
let headerInset: CGFloat
|
||||||
if self.isSettings {
|
if self.isSettings {
|
||||||
headerInset = sectionInset
|
headerInset = sectionInset
|
||||||
@ -6639,7 +6644,12 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
|||||||
|
|
||||||
if let (layout, navigationHeight) = self.validLayout {
|
if let (layout, navigationHeight) = self.validLayout {
|
||||||
if !additive {
|
if !additive {
|
||||||
let sectionInset = max(16.0, floor((layout.size.width - 674.0) / 2.0))
|
let sectionInset: CGFloat
|
||||||
|
if layout.size.width >= 375.0 {
|
||||||
|
sectionInset = max(16.0, floor((layout.size.width - 674.0) / 2.0))
|
||||||
|
} else {
|
||||||
|
sectionInset = 0.0
|
||||||
|
}
|
||||||
let headerInset: CGFloat
|
let headerInset: CGFloat
|
||||||
if self.isSettings {
|
if self.isSettings {
|
||||||
headerInset = sectionInset
|
headerInset = sectionInset
|
||||||
@ -7541,7 +7551,12 @@ private final class PeerInfoNavigationTransitionNode: ASDisplayNode, CustomNavig
|
|||||||
var topHeight = topNavigationBar.backgroundNode.bounds.height
|
var topHeight = topNavigationBar.backgroundNode.bounds.height
|
||||||
|
|
||||||
if let (layout, _) = self.screenNode.validLayout {
|
if let (layout, _) = self.screenNode.validLayout {
|
||||||
let sectionInset = max(16.0, floor((layout.size.width - 674.0) / 2.0))
|
let sectionInset: CGFloat
|
||||||
|
if layout.size.width >= 375.0 {
|
||||||
|
sectionInset = max(16.0, floor((layout.size.width - 674.0) / 2.0))
|
||||||
|
} else {
|
||||||
|
sectionInset = 0.0
|
||||||
|
}
|
||||||
let headerInset: CGFloat
|
let headerInset: CGFloat
|
||||||
if screenNode.isSettings {
|
if screenNode.isSettings {
|
||||||
headerInset = sectionInset
|
headerInset = sectionInset
|
||||||
|
@ -1422,7 +1422,7 @@ public func themeIconImage(account: Account, accountManager: AccountManager<Tele
|
|||||||
|
|
||||||
return patternWallpaperImage(account: account, accountManager: accountManager, representations: convertedPreviewRepresentations, mode: .thumbnail, autoFetchFullSize: true)
|
return patternWallpaperImage(account: account, accountManager: accountManager, representations: convertedPreviewRepresentations, mode: .thumbnail, autoFetchFullSize: true)
|
||||||
|> mapToSignal { generator -> Signal<((UIColor, UIColor?, [UInt32]), [UIColor], [UIColor], UIImage?, Bool, Bool, CGFloat, Int32?), NoError> in
|
|> mapToSignal { generator -> Signal<((UIColor, UIColor?, [UInt32]), [UIColor], [UIColor], UIImage?, Bool, Bool, CGFloat, Int32?), NoError> in
|
||||||
let imageSize = CGSize(width: 120, height: 254)
|
let imageSize = CGSize(width: 148, height: 320)
|
||||||
let imageArguments = TransformImageArguments(corners: ImageCorners(), imageSize: imageSize, boundingSize: imageSize, intrinsicInsets: UIEdgeInsets(), emptyColor: nil, custom: arguments)
|
let imageArguments = TransformImageArguments(corners: ImageCorners(), imageSize: imageSize, boundingSize: imageSize, intrinsicInsets: UIEdgeInsets(), emptyColor: nil, custom: arguments)
|
||||||
let context = generator?(imageArguments)
|
let context = generator?(imageArguments)
|
||||||
let image = context?.generateImage()
|
let image = context?.generateImage()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user