diff --git a/submodules/Display/Source/GenerateImage.swift b/submodules/Display/Source/GenerateImage.swift index 97cd118f4d..59c4234b5c 100644 --- a/submodules/Display/Source/GenerateImage.swift +++ b/submodules/Display/Source/GenerateImage.swift @@ -351,7 +351,7 @@ public func generateGradientTintedImage(image: UIImage?, colors: [UIColor]) -> U let t = CGFloat(i) / CGFloat(colors.count - 1) locations.append(t) } - let colorSpace = CGColorSpaceCreateDeviceRGB() + let colorSpace = DeviceGraphicsContextSettings.shared.colorSpace let gradient = CGGradient(colorsSpace: colorSpace, colors: gradientColors, locations: &locations)! context.drawLinearGradient(gradient, start: CGPoint(x: 0.0, y: imageRect.height), end: CGPoint(x: 0.0, y: 0.0), options: CGGradientDrawingOptions()) @@ -381,7 +381,7 @@ public func generateGradientImage(size: CGSize, colors: [UIColor], locations: [C UIGraphicsBeginImageContextWithOptions(size, false, 0.0) if let context = UIGraphicsGetCurrentContext() { let gradientColors = colors.map { $0.cgColor } as CFArray - let colorSpace = CGColorSpaceCreateDeviceRGB() + let colorSpace = DeviceGraphicsContextSettings.shared.colorSpace var locations = locations let gradient = CGGradient(colorsSpace: colorSpace, colors: gradientColors, locations: &locations)! @@ -403,7 +403,7 @@ public func generateGradientFilledCircleImage(diameter: CGFloat, colors: NSArray context.clip() var locations: [CGFloat] = [0.0, 1.0] - let colorSpace = CGColorSpaceCreateDeviceRGB() + let colorSpace = DeviceGraphicsContextSettings.shared.colorSpace let gradient = CGGradient(colorsSpace: colorSpace, colors: colors, locations: &locations)! context.drawLinearGradient(gradient, start: CGPoint(), end: CGPoint(x: 0.0, y: bounds.size.height), options: CGGradientDrawingOptions()) diff --git a/submodules/Display/Source/NavigationBar.swift b/submodules/Display/Source/NavigationBar.swift index c2ac67ea80..7752442d25 100644 --- a/submodules/Display/Source/NavigationBar.swift +++ b/submodules/Display/Source/NavigationBar.swift @@ -1190,6 +1190,7 @@ open class NavigationBar: ASDisplayNode { self.badgeNode.updateTheme(fillColor: self.presentationData.theme.buttonColor, strokeColor: self.presentationData.theme.buttonColor, textColor: self.presentationData.theme.badgeTextColor) + self.updateLeftButton(animated: false) self.requestLayout() } } diff --git a/submodules/MediaPickerUI/Sources/MediaGroupsAlbumGridItem.swift b/submodules/MediaPickerUI/Sources/MediaGroupsAlbumGridItem.swift index c6df8e16aa..7b1f98b574 100644 --- a/submodules/MediaPickerUI/Sources/MediaGroupsAlbumGridItem.swift +++ b/submodules/MediaPickerUI/Sources/MediaGroupsAlbumGridItem.swift @@ -140,7 +140,7 @@ private final class MediaGroupsGridAlbumItemNode : ListViewItemNode { override func didLoad() { super.didLoad() - self.imageNode.cornerRadius = 10.0 + self.imageNode.cornerRadius = 5.0 if #available(iOS 13.0, *) { self.imageNode.layer.cornerCurve = .continuous } @@ -221,11 +221,11 @@ private func preparedTransition(action: @escaping (PHAssetCollection) -> Void, f } final class MediaGroupsAlbumGridItem: ListViewItem { - let presentationData: ItemListPresentationData + let presentationData: PresentationData let collections: [PHAssetCollection] let action: (PHAssetCollection) -> Void - public init(presentationData: ItemListPresentationData, collections: [PHAssetCollection], action: @escaping (PHAssetCollection) -> Void) { + public init(presentationData: PresentationData, collections: [PHAssetCollection], action: @escaping (PHAssetCollection) -> Void) { self.presentationData = presentationData self.collections = collections self.action = action @@ -347,7 +347,8 @@ private class MediaGroupsAlbumGridItemNode: ListViewItemNode { firstItem = result.firstObject } if let firstItem = firstItem { - entries.append(MediaGroupsGridAlbumEntry(theme: item.presentationData.theme, index: index, collection: collection, firstItem: firstItem, count: presentationStringsFormattedNumber(Int32(result.count)))) + let count = presentationStringsFormattedNumber(Int32(result.count), item.presentationData.dateTimeFormat.groupingSeparator) + entries.append(MediaGroupsGridAlbumEntry(theme: item.presentationData.theme, index: index, collection: collection, firstItem: firstItem, count: count)) index += 1 } } diff --git a/submodules/MediaPickerUI/Sources/MediaGroupsScreen.swift b/submodules/MediaPickerUI/Sources/MediaGroupsScreen.swift index 0f9337ae58..bf94a0446c 100644 --- a/submodules/MediaPickerUI/Sources/MediaGroupsScreen.swift +++ b/submodules/MediaPickerUI/Sources/MediaGroupsScreen.swift @@ -91,7 +91,7 @@ private enum MediaGroupsEntry: Comparable, Identifiable { case let .albumsHeader(_, text), let .smartAlbumsHeader(_, text): return MediaGroupsHeaderItem(presentationData: ItemListPresentationData(presentationData), title: text) case let .albums(_, collections): - return MediaGroupsAlbumGridItem(presentationData: ItemListPresentationData(presentationData), collections: collections, action: { collection in + return MediaGroupsAlbumGridItem(presentationData: presentationData, collections: collections, action: { collection in openGroup(collection) }) case let .smartAlbum(_, _, collection, count): diff --git a/submodules/SettingsUI/Sources/Language Selection/LocalizationListControllerNode.swift b/submodules/SettingsUI/Sources/Language Selection/LocalizationListControllerNode.swift index c7adeb131a..92a77ffb9a 100644 --- a/submodules/SettingsUI/Sources/Language Selection/LocalizationListControllerNode.swift +++ b/submodules/SettingsUI/Sources/Language Selection/LocalizationListControllerNode.swift @@ -612,7 +612,18 @@ final class LocalizationListControllerNode: ViewControllerTracingNode { } func updatePresentationData(_ presentationData: PresentationData) { + let stringsUpdated = self.presentationData.strings !== presentationData.strings self.presentationData = presentationData + + if stringsUpdated { + if let snapshotView = self.view.snapshotView(afterScreenUpdates: false) { + self.view.addSubview(snapshotView) + snapshotView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak snapshotView] _ in + snapshotView?.removeFromSuperview() + }) + } + } + self.presentationDataValue.set(.single(presentationData)) self.backgroundColor = presentationData.theme.list.blocksBackgroundColor self.listNode.keepTopItemOverscrollBackground = ListViewKeepTopItemOverscrollBackground(color: presentationData.theme.list.blocksBackgroundColor, direction: true) diff --git a/submodules/TelegramUI/Sources/AppDelegate.swift b/submodules/TelegramUI/Sources/AppDelegate.swift index 9e064fa2cb..ab73b00203 100644 --- a/submodules/TelegramUI/Sources/AppDelegate.swift +++ b/submodules/TelegramUI/Sources/AppDelegate.swift @@ -319,6 +319,7 @@ private func extractAccountManagerState(records: AccountRecordsView (cleanSize: CGSize, apparentHeight: CGFloat) { - let constrainedSize = CGSize(width: min(260.0, constrainedWidth), height: min(604.0, maxHeight)) + let constrainedSize = CGSize(width: min(220.0, constrainedWidth), height: min(604.0, maxHeight)) var topContentHeight: CGFloat = 0.0 if let backButtonNode = self.backButtonNode { diff --git a/submodules/WebSearchUI/Sources/WebSearchControllerNode.swift b/submodules/WebSearchUI/Sources/WebSearchControllerNode.swift index fc840cb691..666a768400 100644 --- a/submodules/WebSearchUI/Sources/WebSearchControllerNode.swift +++ b/submodules/WebSearchUI/Sources/WebSearchControllerNode.swift @@ -245,9 +245,9 @@ class WebSearchControllerNode: ASDisplayNode { self.addSubnode(self.segmentedContainerNode) self.segmentedContainerNode.addSubnode(self.segmentedBackgroundNode) self.segmentedContainerNode.addSubnode(self.segmentedSeparatorNode) - if case .media = mode { - self.segmentedContainerNode.addSubnode(self.segmentedControlNode) - } +// if case .media = mode { +// self.segmentedContainerNode.addSubnode(self.segmentedControlNode) +// } if !attachment { self.addSubnode(self.toolbarBackgroundNode) self.addSubnode(self.toolbarSeparatorNode)