From 68e8c3a4f963c7ede99bf195ca7f4685869291b0 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Fri, 26 Feb 2021 18:37:48 +0400 Subject: [PATCH] Various Fixes --- .../Sources/ChatChannelSubscriberInputPanelNode.swift | 2 +- submodules/TelegramUI/Sources/PollResultsController.swift | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/submodules/TelegramUI/Sources/ChatChannelSubscriberInputPanelNode.swift b/submodules/TelegramUI/Sources/ChatChannelSubscriberInputPanelNode.swift index a8ac0c03f9..ae9049372a 100644 --- a/submodules/TelegramUI/Sources/ChatChannelSubscriberInputPanelNode.swift +++ b/submodules/TelegramUI/Sources/ChatChannelSubscriberInputPanelNode.swift @@ -246,7 +246,7 @@ final class ChatChannelSubscriberInputPanelNode: ChatInputPanelNode { if self.discussButton.isHidden { if let action = self.action, action == .muteNotifications || action == .unmuteNotifications { - let buttonWidth = self.button.titleNode.calculateSizeThatFits(CGSize(width: width, height: panelHeight)).width + 24.0 + let buttonWidth = self.button.calculateSizeThatFits(CGSize(width: width, height: panelHeight)).width + 24.0 self.button.frame = CGRect(origin: CGPoint(x: floor((width - buttonWidth) / 2.0), y: 0.0), size: CGSize(width: buttonWidth, height: panelHeight)) if let peer = interfaceState.renderedPeer?.peer as? TelegramChannel, peer.flags.contains(.isGigagroup) { diff --git a/submodules/TelegramUI/Sources/PollResultsController.swift b/submodules/TelegramUI/Sources/PollResultsController.swift index 6430f1803b..d9b65023e2 100644 --- a/submodules/TelegramUI/Sources/PollResultsController.swift +++ b/submodules/TelegramUI/Sources/PollResultsController.swift @@ -11,7 +11,7 @@ import ItemListPeerItem import ItemListPeerActionItem private let collapsedResultCount: Int = 10 -private let collapsedInitialLimit: Int = 14 +private let collapsedInitialLimit: Int = 10 private final class PollResultsControllerArguments { let context: AccountContext @@ -269,7 +269,7 @@ private func pollResultsControllerEntries(presentationData: PresentationData, po let count = optionState.count let displayCount: Int - if peers.count > collapsedInitialLimit + 1 { + if peers.count > collapsedInitialLimit { if optionExpandedAtCount != nil { displayCount = peers.count } else { @@ -277,7 +277,7 @@ private func pollResultsControllerEntries(presentationData: PresentationData, po } } else { if let optionExpandedAtCount = optionExpandedAtCount { - if optionExpandedAtCount == collapsedInitialLimit + 1 && optionState.canLoadMore { + if optionExpandedAtCount == collapsedInitialLimit && optionState.canLoadMore { displayCount = collapsedResultCount } else { displayCount = peers.count