mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Avatar setup improvements
This commit is contained in:
@@ -1145,6 +1145,11 @@
|
||||
return _intent & (TGPhotoEditorControllerForumAvatarIntent);
|
||||
}
|
||||
|
||||
- (bool)presentedForSuggestedAvatar
|
||||
{
|
||||
return _intent & (TGPhotoEditorControllerSuggestedAvatarIntent);
|
||||
}
|
||||
|
||||
#pragma mark - Transition
|
||||
|
||||
- (void)transitionIn
|
||||
@@ -1317,6 +1322,10 @@
|
||||
TGPhotoEditorBackButton backButtonType = TGPhotoEditorBackButtonCancel;
|
||||
TGPhotoEditorDoneButton doneButtonType = TGPhotoEditorDoneButtonCheck;
|
||||
|
||||
if ([self presentedForSuggestedAvatar]) {
|
||||
[_portraitToolbarView setCancelDoneButtonsHidden:tab == TGPhotoEditorCropTab animated:!isInitialAppearance];
|
||||
}
|
||||
|
||||
__weak TGPhotoEditorController *weakSelf = self;
|
||||
TGPhotoEditorTabController *controller = nil;
|
||||
switch (tab)
|
||||
@@ -1332,7 +1341,8 @@
|
||||
{
|
||||
bool skipInitialTransition = (![self presentedFromCamera] && self.navigationController != nil) || self.skipInitialTransition;
|
||||
|
||||
TGPhotoAvatarPreviewController *cropController = [[TGPhotoAvatarPreviewController alloc] initWithContext:_context photoEditor:_photoEditor previewView:_previewView isForum:[self presentedForForumAvatarCreation]];
|
||||
TGPhotoAvatarPreviewController *cropController = [[TGPhotoAvatarPreviewController alloc] initWithContext:_context photoEditor:_photoEditor previewView:_previewView isForum:[self presentedForForumAvatarCreation] isSuggestion:[self presentedForSuggestedAvatar]];
|
||||
cropController.stickersContext = _stickersContext;
|
||||
cropController.scrubberView = _scrubberView;
|
||||
cropController.dotImageView = _dotImageView;
|
||||
cropController.dotMarkerView = _dotMarkerView;
|
||||
@@ -1460,6 +1470,20 @@
|
||||
|
||||
[strongSelf returnFullPreviewView];
|
||||
};
|
||||
cropController.cancelPressed = ^{
|
||||
__strong TGPhotoEditorController *strongSelf = weakSelf;
|
||||
if (strongSelf == nil)
|
||||
return;
|
||||
|
||||
strongSelf->_portraitToolbarView.cancelPressed();
|
||||
};
|
||||
cropController.donePressed = ^{
|
||||
__strong TGPhotoEditorController *strongSelf = weakSelf;
|
||||
if (strongSelf == nil)
|
||||
return;
|
||||
|
||||
strongSelf->_portraitToolbarView.donePressed();
|
||||
};
|
||||
controller = cropController;
|
||||
|
||||
doneButtonType = TGPhotoEditorDoneButtonDone;
|
||||
|
||||
Reference in New Issue
Block a user