From a10973f8252614711c45c9fdd958645633982c96 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Sat, 13 Apr 2019 11:01:33 -0600 Subject: [PATCH] align stop icons between picker and capture --- .../Photos/ImagePickerController.swift | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Signal/src/ViewControllers/Photos/ImagePickerController.swift b/Signal/src/ViewControllers/Photos/ImagePickerController.swift index 2e1e13cce..04777933e 100644 --- a/Signal/src/ViewControllers/Photos/ImagePickerController.swift +++ b/Signal/src/ViewControllers/Photos/ImagePickerController.swift @@ -58,9 +58,14 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat view.backgroundColor = .ows_gray95 - let cancelButton = UIBarButtonItem(barButtonSystemItem: .stop, - target: self, - action: #selector(didPressCancel)) + // The PhotoCaptureVC needs a shadow behind it's cancel button, so we use a custom icon. + // This VC has a visible navbar so doesn't need the shadow, but because the user can + // quickly toggle between the Capture and the Picker VC's, we use the same custom "X" + // icon here rather than the system "stop" icon so that the spacing matches exactly. + // Otherwise there's a noticable shift in the icon placement. + let cancelImage = UIImage(imageLiteralResourceName: "ic_x_with_shadow") + let cancelButton = UIBarButtonItem(image: cancelImage, style: .plain, target: self, action: #selector(didPressCancel)) + cancelButton.tintColor = .ows_gray05 navigationItem.leftBarButtonItem = cancelButton