From 8d44e4d9c6b60ebdd77566bd24315e92323465f7 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Tue, 5 Nov 2024 21:38:27 +0100 Subject: [PATCH] Fix camera layout --- .../LegacyComponents/Sources/TGAttachmentCarouselItemView.m | 1 + .../LegacyComponents/Sources/TGMediaAssetsPickerController.m | 1 + submodules/LegacyComponents/Sources/TGMediaAvatarMenuMixin.m | 1 + .../Components/LegacyCamera/Sources/LegacyCamera.swift | 1 + 4 files changed, 4 insertions(+) diff --git a/submodules/LegacyComponents/Sources/TGAttachmentCarouselItemView.m b/submodules/LegacyComponents/Sources/TGAttachmentCarouselItemView.m index 22d9c03d913..d64d69ffa17 100644 --- a/submodules/LegacyComponents/Sources/TGAttachmentCarouselItemView.m +++ b/submodules/LegacyComponents/Sources/TGAttachmentCarouselItemView.m @@ -920,6 +920,7 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPa } TGPhotoEditorController *controller = [[TGPhotoEditorController alloc] initWithContext:[windowManager context] item:editableItem intent:intent adjustments:nil caption:nil screenImage:thumbnailImage availableTabs:[TGPhotoEditorController defaultTabsForAvatarIntent:!_disableStickers] selectedTab:TGPhotoEditorCropTab]; + controller.modalPresentationStyle = UIModalPresentationFullScreen; controller.editingContext = _editingContext; controller.stickersContext = _stickersContext; controller.dontHideStatusBar = true; diff --git a/submodules/LegacyComponents/Sources/TGMediaAssetsPickerController.m b/submodules/LegacyComponents/Sources/TGMediaAssetsPickerController.m index 493ff73f5ac..a71c324917b 100644 --- a/submodules/LegacyComponents/Sources/TGMediaAssetsPickerController.m +++ b/submodules/LegacyComponents/Sources/TGMediaAssetsPickerController.m @@ -449,6 +449,7 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPa } TGPhotoEditorController *controller = [[TGPhotoEditorController alloc] initWithContext:_context item:editableItem intent:intent adjustments:nil caption:nil screenImage:thumbnailImage availableTabs:[TGPhotoEditorController defaultTabsForAvatarIntent:_intent != TGMediaAssetsControllerSetSignupProfilePhotoIntent] selectedTab:TGPhotoEditorCropTab]; + controller.modalPresentationStyle = UIModalPresentationFullScreen; controller.stickersContext = self.stickersContext; controller.editingContext = self.editingContext; controller.didFinishRenderingFullSizeImage = ^(UIImage *resultImage) diff --git a/submodules/LegacyComponents/Sources/TGMediaAvatarMenuMixin.m b/submodules/LegacyComponents/Sources/TGMediaAvatarMenuMixin.m index ebd4719cfb0..b415e1b0cb2 100644 --- a/submodules/LegacyComponents/Sources/TGMediaAvatarMenuMixin.m +++ b/submodules/LegacyComponents/Sources/TGMediaAvatarMenuMixin.m @@ -340,6 +340,7 @@ - (void)_displayCameraWithView:(TGAttachmentCameraView *)cameraView menuControll controller = [[TGCameraController alloc] initWithContext:[windowManager context] saveEditedPhotos:_saveEditedPhotos saveCapturedMedia:_saveCapturedMedia camera:cameraView.previewView.camera previewView:cameraView.previewView intent:_signup ? TGCameraControllerSignupAvatarIntent : TGCameraControllerAvatarIntent]; else controller = [[TGCameraController alloc] initWithContext:[windowManager context] saveEditedPhotos:_saveEditedPhotos saveCapturedMedia:_saveCapturedMedia intent:_signup ? TGCameraControllerSignupAvatarIntent : TGCameraControllerAvatarIntent]; + controller.modalPresentationStyle = UIModalPresentationFullScreen; controller.stickersContext = _stickersContext; controller.shouldStoreCapturedAssets = true; diff --git a/submodules/TelegramUI/Components/LegacyCamera/Sources/LegacyCamera.swift b/submodules/TelegramUI/Components/LegacyCamera/Sources/LegacyCamera.swift index 17eccfc3ea3..0cac4f3e967 100644 --- a/submodules/TelegramUI/Components/LegacyCamera/Sources/LegacyCamera.swift +++ b/submodules/TelegramUI/Components/LegacyCamera/Sources/LegacyCamera.swift @@ -35,6 +35,7 @@ public func presentedLegacyCamera(context: AccountContext, peer: Peer?, chatLoca } else { controller = TGCameraController(context: legacyController.context, saveEditedPhotos: saveCapturedPhotos && !isSecretChat, saveCapturedMedia: saveCapturedPhotos && !isSecretChat) } + controller.modalPresentationStyle = .fullScreen controller.inhibitMultipleCapture = editingMedia if !initialCaption.string.isEmpty {