Skip to content

Commit a4ed31d

Browse files
committed
Various improvements
1 parent 1e80012 commit a4ed31d

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

submodules/TelegramUI/Components/ChatThemeScreen/Sources/ChatThemeScreen.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ private struct ThemeSettingsThemeEntry: Comparable, Identifiable {
3535
let strings: PresentationStrings
3636
let wallpaper: TelegramWallpaper?
3737

38-
var stableId: Int {
39-
return index
38+
var stableId: String {
39+
return self.chatTheme?.id ?? "\(self.index)"
4040
}
4141

4242
static func ==(lhs: ThemeSettingsThemeEntry, rhs: ThemeSettingsThemeEntry) -> Bool {
@@ -524,11 +524,13 @@ private final class ThemeSettingsThemeItemIconNode : ListViewItemNode {
524524
if let theme = item.chatTheme, case let .gift(_, themeSettings) = theme {
525525
if item.nightMode {
526526
if let theme = themeSettings.first(where: { $0.baseTheme == .night || $0.baseTheme == .tinted }) {
527-
bubbleColor = UIColor(rgb: UInt32(bitPattern: theme.accentColor))
527+
let color = theme.wallpaper?.settings?.colors.first ?? theme.accentColor
528+
bubbleColor = UIColor(rgb: UInt32(bitPattern: color))
528529
}
529530
} else {
530531
if let theme = themeSettings.first(where: { $0.baseTheme == .classic || $0.baseTheme == .day }) {
531-
bubbleColor = UIColor(rgb: UInt32(bitPattern: theme.accentColor))
532+
let color = theme.wallpaper?.settings?.colors.first ?? theme.accentColor
533+
bubbleColor = UIColor(rgb: UInt32(bitPattern: color))
532534
}
533535
}
534536
}
@@ -964,7 +966,6 @@ private class ChatThemeScreenNode: ViewControllerTracingNode, ASScrollViewDelega
964966
self.cancelButtonNode.buttonNode.addTarget(self, action: #selector(self.cancelButtonPressed), forControlEvents: .touchUpInside)
965967
self.doneButton.pressed = { [weak self] in
966968
if let strongSelf = self {
967-
strongSelf.doneButton.isUserInteractionEnabled = false
968969
if strongSelf.doneButton.font == .bold {
969970
strongSelf.complete()
970971
} else {
@@ -1349,6 +1350,7 @@ private class ChatThemeScreenNode: ViewControllerTracingNode, ASScrollViewDelega
13491350

13501351
func complete() {
13511352
let proceed = {
1353+
self.doneButton.isUserInteractionEnabled = false
13521354
self.completion?(self.selectedTheme)
13531355
}
13541356
if case let .gift(gift, _) = self.selectedTheme, case let .unique(uniqueGift) = gift, let themePeerId = uniqueGift.themePeerId {

submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/GiftsListView.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ final class GiftsListView: UIView {
996996

997997
fadeTransition.setAlpha(view: self.emptyResultsClippingView, alpha: visibleHeight < 300.0 ? 0.0 : 1.0)
998998

999-
if self.peerId == self.context.account.peerId, !self.canSelect && !self.filteredResultsAreEmpty && self.profileGifts.collectionId == nil {
999+
if self.peerId == self.context.account.peerId, !self.canSelect && !self.filteredResultsAreEmpty && self.profileGifts.collectionId == nil && self.emptyResultsClippingView.isHidden {
10001000
let footerText: ComponentView<Empty>
10011001
if let current = self.footerText {
10021002
footerText = current
@@ -1024,6 +1024,13 @@ final class GiftsListView: UIView {
10241024
transition.setFrame(view: view, frame: CGRect(origin: CGPoint(x: floor((size.width - footerTextSize.width) / 2.0), y: contentHeight), size: footerTextSize))
10251025
}
10261026
contentHeight += footerTextSize.height
1027+
} else if let footerText = self.footerText {
1028+
self.footerText = nil
1029+
if let view = footerText.view {
1030+
fadeTransition.setAlpha(view: view, alpha: 0.0, completion: { _ in
1031+
view.removeFromSuperview()
1032+
})
1033+
}
10271034
}
10281035

10291036
return contentHeight

submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/PeerInfoGiftsPaneNode.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ public final class PeerInfoGiftsPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScr
9090
private let tabSelector = ComponentView<Empty>()
9191
public private(set) var currentCollection: GiftCollection = .all
9292

93-
private var footerText: ComponentView<Empty>?
9493
private var panelBackground: NavigationBackgroundNode?
9594
private var panelSeparator: ASDisplayNode?
9695
private var panelButton: ComponentView<Empty>?

0 commit comments

Comments
 (0)