From 0928eb41f5ec66010cbf91ae568340b5370dff07 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Sun, 3 Nov 2024 10:47:41 +0100 Subject: [PATCH 1/2] Fix camera layout --- .../LegacyComponents/Sources/TGCameraController.m | 12 +++++++++--- .../Sources/TGCameraMainPhoneView.m | 13 ++++++++++++- .../Sources/GiftItemComponent.swift | 4 +--- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/submodules/LegacyComponents/Sources/TGCameraController.m b/submodules/LegacyComponents/Sources/TGCameraController.m index e1b3d91134..249ea16b91 100644 --- a/submodules/LegacyComponents/Sources/TGCameraController.m +++ b/submodules/LegacyComponents/Sources/TGCameraController.m @@ -2743,7 +2743,11 @@ static CGPoint TGCameraControllerClampPointToScreenSize(__unused id self, __unus { case PGCameraModeVideo: { - if (widescreenWidth == 926.0f) + if (widescreenWidth == 956.0f) + return CGRectMake(0, 82, screenSize.width, screenSize.height - 82 - 83); + else if (widescreenWidth == 932.0f) + return CGRectMake(0, 82, screenSize.width, screenSize.height - 82 - 83); + else if (widescreenWidth == 926.0f) return CGRectMake(0, 82, screenSize.width, screenSize.height - 82 - 83); else if (widescreenWidth == 896.0f) return CGRectMake(0, 77, screenSize.width, screenSize.height - 77 - 83); @@ -2770,13 +2774,15 @@ static CGPoint TGCameraControllerClampPointToScreenSize(__unused id self, __unus default: { - if (widescreenWidth == 932.0f) + if (widescreenWidth == 956.0f) + return CGRectMake(0, 136, screenSize.width, screenSize.height - 136 - 234); + else if (widescreenWidth == 932.0f) return CGRectMake(0, 136, screenSize.width, screenSize.height - 136 - 223); else if (widescreenWidth == 926.0f) return CGRectMake(0, 121, screenSize.width, screenSize.height - 121 - 234); else if (widescreenWidth == 896.0f) return CGRectMake(0, 121, screenSize.width, screenSize.height - 121 - 223); - if (widescreenWidth == 852.0f) + else if (widescreenWidth == 852.0f) return CGRectMake(0, 136, screenSize.width, screenSize.height - 136 - 192); else if (widescreenWidth == 844.0f) return CGRectMake(0, 77, screenSize.width, screenSize.height - 77 - 191); diff --git a/submodules/LegacyComponents/Sources/TGCameraMainPhoneView.m b/submodules/LegacyComponents/Sources/TGCameraMainPhoneView.m index fcca1b123f..8887b8165e 100644 --- a/submodules/LegacyComponents/Sources/TGCameraMainPhoneView.m +++ b/submodules/LegacyComponents/Sources/TGCameraMainPhoneView.m @@ -113,7 +113,18 @@ CGFloat shutterButtonWidth = 66.0f; CGSize screenSize = TGScreenSize(); CGFloat widescreenWidth = MAX(screenSize.width, screenSize.height); - if (widescreenWidth == 932.0f) + if (widescreenWidth == 956.0f) + { + _topPanelOffset = 48.0f; + _topPanelHeight = 48.0f; + _bottomPanelOffset = 83.0f; + _bottomPanelHeight = 140.0f; + _modeControlOffset = -1.0f; + _modeControlHeight = 66.0f; + _counterOffset = 7.0f; + shutterButtonWidth = 72.0f; + } + else if (widescreenWidth == 932.0f) { _topPanelOffset = 48.0f; _topPanelHeight = 48.0f; diff --git a/submodules/TelegramUI/Components/Gifts/GiftItemComponent/Sources/GiftItemComponent.swift b/submodules/TelegramUI/Components/Gifts/GiftItemComponent/Sources/GiftItemComponent.swift index 1ed7108d39..669f634955 100644 --- a/submodules/TelegramUI/Components/Gifts/GiftItemComponent/Sources/GiftItemComponent.swift +++ b/submodules/TelegramUI/Components/Gifts/GiftItemComponent/Sources/GiftItemComponent.swift @@ -31,13 +31,11 @@ public final class GiftItemComponent: Component { return [ UIColor(rgb: 0x522124), UIColor(rgb: 0x653634) - ] } else { return [ UIColor(rgb: 0xed1c26), UIColor(rgb: 0xff5c55) - ] } case .blue: @@ -359,7 +357,7 @@ public final class GiftItemComponent: Component { } ribbonTextView.bounds = CGRect(origin: .zero, size: ribbonTextSize) - if self.ribbon.image == nil || themeUpdated { + if self.ribbon.image == nil || themeUpdated || previousComponent?.ribbon?.color != component.ribbon?.color { self.ribbon.image = generateGradientTintedImage(image: UIImage(bundleImageName: "Premium/GiftRibbon"), colors: ribbon.color.colors(theme: component.theme), direction: .diagonal) } if let ribbonImage = self.ribbon.image { From 0b6c9946b23dc76592eff15e3e0a3b0169882de0 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Sun, 3 Nov 2024 11:04:15 +0100 Subject: [PATCH 2/2] Fix camera layout --- submodules/LegacyComponents/Sources/TGCameraController.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/submodules/LegacyComponents/Sources/TGCameraController.m b/submodules/LegacyComponents/Sources/TGCameraController.m index 249ea16b91..bd0fec83a4 100644 --- a/submodules/LegacyComponents/Sources/TGCameraController.m +++ b/submodules/LegacyComponents/Sources/TGCameraController.m @@ -2751,6 +2751,8 @@ static CGPoint TGCameraControllerClampPointToScreenSize(__unused id self, __unus return CGRectMake(0, 82, screenSize.width, screenSize.height - 82 - 83); else if (widescreenWidth == 896.0f) return CGRectMake(0, 77, screenSize.width, screenSize.height - 77 - 83); + else if (widescreenWidth == 874.0f) + return CGRectMake(0, 77, screenSize.width, screenSize.height - 77 - 83); else if (widescreenWidth == 812.0f) return CGRectMake(0, 77, screenSize.width, screenSize.height - 77 - 68); else @@ -2782,6 +2784,8 @@ static CGPoint TGCameraControllerClampPointToScreenSize(__unused id self, __unus return CGRectMake(0, 121, screenSize.width, screenSize.height - 121 - 234); else if (widescreenWidth == 896.0f) return CGRectMake(0, 121, screenSize.width, screenSize.height - 121 - 223); + else if (widescreenWidth == 874.0f) + return CGRectMake(0, 121, screenSize.width, screenSize.height - 135 - 202); else if (widescreenWidth == 852.0f) return CGRectMake(0, 136, screenSize.width, screenSize.height - 136 - 192); else if (widescreenWidth == 844.0f)