diff --git a/Signal/Images.xcassets/x-24.imageset/Contents.json b/Signal/Images.xcassets/x-24.imageset/Contents.json new file mode 100644 index 000000000..1f25af162 --- /dev/null +++ b/Signal/Images.xcassets/x-24.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "x-24@1x.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "x-24@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "x-24@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Signal/Images.xcassets/x-24.imageset/x-24@1x.png b/Signal/Images.xcassets/x-24.imageset/x-24@1x.png new file mode 100644 index 000000000..ee6d0b887 Binary files /dev/null and b/Signal/Images.xcassets/x-24.imageset/x-24@1x.png differ diff --git a/Signal/Images.xcassets/x-24.imageset/x-24@2x.png b/Signal/Images.xcassets/x-24.imageset/x-24@2x.png new file mode 100644 index 000000000..ea502285c Binary files /dev/null and b/Signal/Images.xcassets/x-24.imageset/x-24@2x.png differ diff --git a/Signal/Images.xcassets/x-24.imageset/x-24@3x.png b/Signal/Images.xcassets/x-24.imageset/x-24@3x.png new file mode 100644 index 000000000..cbb9bb263 Binary files /dev/null and b/Signal/Images.xcassets/x-24.imageset/x-24@3x.png differ diff --git a/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift b/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift index 40e681eda..a442a68aa 100644 --- a/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift +++ b/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift @@ -1676,12 +1676,14 @@ public class ApprovalRailCellView: GalleryRailCellView { strongSelf.approvalRailCellDelegate?.approvalRailCellView(strongSelf, didRemoveItem: attachmentItem) } - button.setImage(#imageLiteral(resourceName: "ic_circled_x"), for: .normal) + button.setImage(UIImage(named: "x-24")?.withRenderingMode(.alwaysTemplate), for: .normal) + button.tintColor = .white + button.layer.shadowColor = UIColor.black.cgColor + button.layer.shadowRadius = 2 + button.layer.shadowOpacity = 0.66 + button.layer.shadowOffset = .zero - let kInsetDistance: CGFloat = 5 - button.imageEdgeInsets = UIEdgeInsets(top: kInsetDistance, left: kInsetDistance, bottom: kInsetDistance, right: kInsetDistance) - - let kButtonWidth: CGFloat = 24 + kInsetDistance * 2 + let kButtonWidth: CGFloat = 24 button.autoSetDimensions(to: CGSize(width: kButtonWidth, height: kButtonWidth)) return button @@ -1704,8 +1706,8 @@ public class ApprovalRailCellView: GalleryRailCellView { if isSelected { addSubview(deleteButton) - deleteButton.autoPinEdge(toSuperviewEdge: .top, withInset: -12) - deleteButton.autoPinEdge(toSuperviewEdge: .trailing, withInset: -8) + deleteButton.autoPinEdge(toSuperviewEdge: .top, withInset: cellBorderWidth) + deleteButton.autoPinEdge(toSuperviewEdge: .trailing, withInset: cellBorderWidth + 4) } else { deleteButton.removeFromSuperview() } @@ -1726,8 +1728,8 @@ public class ApprovalRailCellView: GalleryRailCellView { if hasCaption { addSubview(captionIndicator) - captionIndicator.autoPinEdge(toSuperviewEdge: .top, withInset: 2) - captionIndicator.autoPinEdge(toSuperviewEdge: .leading, withInset: 6) + captionIndicator.autoPinEdge(toSuperviewEdge: .top, withInset: cellBorderWidth) + captionIndicator.autoPinEdge(toSuperviewEdge: .leading, withInset: cellBorderWidth + 4) } else { captionIndicator.removeFromSuperview() } diff --git a/SignalMessaging/Views/GalleryRailView.swift b/SignalMessaging/Views/GalleryRailView.swift index 66690ab2a..6f797ea6b 100644 --- a/SignalMessaging/Views/GalleryRailView.swift +++ b/SignalMessaging/Views/GalleryRailView.swift @@ -63,17 +63,18 @@ public class GalleryRailCellView: UIView { private(set) var isSelected: Bool = false + public let cellBorderWidth: CGFloat = 2 + func setIsSelected(_ isSelected: Bool) { - let borderWidth: CGFloat = 2 self.isSelected = isSelected // Reserve space for the selection border whether or not the cell is selected. - layoutMargins = UIEdgeInsets(top: 0, left: borderWidth, bottom: 0, right: borderWidth) + layoutMargins = UIEdgeInsets(top: 0, left: cellBorderWidth, bottom: 0, right: cellBorderWidth) if isSelected { imageView.layer.borderColor = Theme.galleryHighlightColor.cgColor - imageView.layer.borderWidth = borderWidth - imageView.layer.cornerRadius = borderWidth + imageView.layer.borderWidth = cellBorderWidth + imageView.layer.cornerRadius = cellBorderWidth } else { imageView.layer.borderWidth = 0 imageView.layer.cornerRadius = 0