mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Various fixes
This commit is contained in:
parent
45a9f55b0b
commit
ad0f639fb5
9 changed files with 48 additions and 20 deletions
|
|
@ -15892,6 +15892,7 @@ Error: %8$@";
|
|||
"GroupPermission.AddException" = "Add Exception";
|
||||
|
||||
"GroupInfo.ActionSend" = "Send Message";
|
||||
"GroupInfo.ActionAddRank" = "Add Member Tag";
|
||||
"GroupInfo.ActionEditRank" = "Edit Member Tag";
|
||||
"GroupInfo.ActionEditAdminRank" = "Edit Admin Tag";
|
||||
"GroupInfo.ActionEditAdmin" = "Edit Admin Rights";
|
||||
|
|
|
|||
|
|
@ -2083,8 +2083,12 @@ public final class ContactListNode: ASDisplayNode {
|
|||
strongSelf.presentationData = presentationData
|
||||
|
||||
if previousTheme !== presentationData.theme || previousStrings !== presentationData.strings {
|
||||
strongSelf.backgroundColor = presentationData.theme.chatList.backgroundColor
|
||||
strongSelf.listNode.verticalScrollIndicatorColor = presentationData.theme.list.scrollIndicatorColor
|
||||
strongSelf.backgroundColor = listStyle == .blocks ? strongSelf.presentationData.theme.list.blocksBackgroundColor : strongSelf.presentationData.theme.chatList.backgroundColor
|
||||
if listStyle == .blocks {
|
||||
strongSelf.listNode.verticalScrollIndicatorColor = .clear
|
||||
} else {
|
||||
strongSelf.listNode.verticalScrollIndicatorColor = strongSelf.presentationData.theme.list.scrollIndicatorColor
|
||||
}
|
||||
strongSelf.presentationDataPromise.set(.single(presentationData))
|
||||
|
||||
let authorizationPreviousHidden = strongSelf.authorizationNode.isHidden
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ final class AttachmentFileEmptyStateItemNode: ItemListControllerEmptyStateItemNo
|
|||
insets.top += -60.0
|
||||
imageSize = CGSize(width: 112.0, height: 112.0)
|
||||
} else {
|
||||
insets.top += 30.0 //-160.0
|
||||
insets.top += 120.0
|
||||
}
|
||||
|
||||
let imageSpacing: CGFloat = 12.0
|
||||
|
|
|
|||
|
|
@ -975,8 +975,6 @@ public final class MediaEditor {
|
|||
|
||||
if let _ = textureSourceResult.player {
|
||||
self.updateRenderChain()
|
||||
// let _ = image
|
||||
// self.maybeGeneratePersonSegmentation(image)
|
||||
}
|
||||
|
||||
if let _ = self.values.audioTrack {
|
||||
|
|
|
|||
|
|
@ -3958,16 +3958,18 @@ public final class MediaEditorScreenImpl: ViewController, MediaEditorScreen, UID
|
|||
self.stickerMaskWrapperView.addSubview(self.stickerMaskPreviewView)
|
||||
self.stickerMaskDrawingView = stickerMaskDrawingView
|
||||
|
||||
let previewSize = self.previewView.bounds.size
|
||||
self.stickerMaskWrapperView.frame = CGRect(origin: .zero, size: previewSize)
|
||||
self.stickerMaskPreviewView.frame = CGRect(origin: .zero, size: previewSize)
|
||||
|
||||
let maskScale = previewSize.width / min(maskDrawingSize.width, maskDrawingSize.height)
|
||||
self.initialMaskScale = maskScale
|
||||
self.initialMaskPosition = CGPoint(x: previewSize.width / 2.0, y: previewSize.height / 2.0)
|
||||
stickerMaskDrawingView.bounds = CGRect(origin: .zero, size: maskDrawingSize)
|
||||
|
||||
self.updateMaskDrawingView(position: .zero, scale: 1.0, rotation: 0.0)
|
||||
Queue.mainQueue().justDispatch {
|
||||
let previewSize = self.previewView.bounds.size
|
||||
self.stickerMaskWrapperView.frame = CGRect(origin: .zero, size: previewSize)
|
||||
self.stickerMaskPreviewView.frame = CGRect(origin: .zero, size: previewSize)
|
||||
|
||||
let maskScale = previewSize.width / min(maskDrawingSize.width, maskDrawingSize.height)
|
||||
self.initialMaskScale = maskScale
|
||||
self.initialMaskPosition = CGPoint(x: previewSize.width / 2.0, y: previewSize.height / 2.0)
|
||||
stickerMaskDrawingView.bounds = CGRect(origin: .zero, size: maskDrawingSize)
|
||||
|
||||
self.updateMaskDrawingView(position: .zero, scale: 1.0, rotation: 0.0)
|
||||
}
|
||||
}
|
||||
|
||||
private func updateMaskDrawingView(position: CGPoint, scale: CGFloat, rotation: CGFloat) {
|
||||
|
|
|
|||
|
|
@ -147,7 +147,15 @@ private final class PeerInfoScreenMemberItemNode: PeerInfoScreenItemNode {
|
|||
case .admin:
|
||||
label = presentationData.strings.GroupInfo_LabelAdmin
|
||||
case .member:
|
||||
if item.member.id == item.context.accountPeerId, let enclosingPeer = item.enclosingPeer as? TelegramChannel, enclosingPeer.hasPermission(.editRank) {
|
||||
var canEditRank = false
|
||||
if item.member.id == item.context.accountPeerId {
|
||||
if let channel = item.enclosingPeer as? TelegramChannel, channel.hasPermission(.editRank) {
|
||||
canEditRank = true
|
||||
} else if let group = item.enclosingPeer as? TelegramGroup, !group.hasBannedPermission(.banEditRank) {
|
||||
canEditRank = true
|
||||
}
|
||||
}
|
||||
if canEditRank {
|
||||
label = presentationData.strings.GroupInfo_AddRank
|
||||
labelColor = presentationData.theme.list.itemAccentColor
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -107,7 +107,15 @@ private enum PeerMembersListEntry: Comparable, Identifiable {
|
|||
case .admin:
|
||||
label = presentationData.strings.GroupInfo_LabelAdmin
|
||||
case .member:
|
||||
if member.id == context.account.peerId, let enclosingPeer = enclosingPeer as? TelegramChannel, enclosingPeer.hasPermission(.editRank) {
|
||||
var canEditRank = false
|
||||
if member.id == context.account.peerId {
|
||||
if let channel = enclosingPeer as? TelegramChannel, channel.hasPermission(.editRank) {
|
||||
canEditRank = true
|
||||
} else if let group = enclosingPeer as? TelegramGroup, !group.hasBannedPermission(.banEditRank) {
|
||||
canEditRank = true
|
||||
}
|
||||
}
|
||||
if canEditRank {
|
||||
label = presentationData.strings.GroupInfo_AddRank
|
||||
labelColor = presentationData.theme.list.itemAccentColor
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -31,9 +31,15 @@ extension PeerInfoScreenNode {
|
|||
}
|
||||
|
||||
if actions.contains(.editRank) {
|
||||
var actionTitle: String = self.presentationData.strings.GroupInfo_ActionEditRank
|
||||
let actionTitle: String
|
||||
if case .admin = member.role {
|
||||
actionTitle = self.presentationData.strings.GroupInfo_ActionEditAdminRank
|
||||
} else {
|
||||
if let rank = member.rank, !rank.isEmpty {
|
||||
actionTitle = self.presentationData.strings.GroupInfo_ActionEditRank
|
||||
} else {
|
||||
actionTitle = self.presentationData.strings.GroupInfo_ActionAddRank
|
||||
}
|
||||
}
|
||||
items.append(.action(ContextMenuActionItem(text: actionTitle, icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Tag"), color: theme.contextMenu.primaryColor) }, action: { [weak self] c, _ in
|
||||
c?.dismiss {
|
||||
|
|
|
|||
|
|
@ -157,9 +157,10 @@ class ContactSelectionControllerImpl: ViewController, ContactSelectionController
|
|||
let previousTheme = self.presentationData.theme
|
||||
let previousStrings = self.presentationData.strings
|
||||
|
||||
self.presentationData = presentationData
|
||||
if case .glass = params.style {
|
||||
self.presentationData = self.presentationData.withUpdated(theme: self.presentationData.theme.withModalBlocksBackground())
|
||||
self.presentationData = self.presentationData.withUpdated(theme: presentationData.theme.withModalBlocksBackground())
|
||||
} else {
|
||||
self.presentationData = presentationData
|
||||
}
|
||||
|
||||
if previousTheme !== presentationData.theme || previousStrings !== presentationData.strings {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue