From ac3743f8107dcd3bf90ac9255686c33e1020921a Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 29 Aug 2017 13:20:46 -0400 Subject: [PATCH] Fix RTL layout of system message cells. // FREEBIE --- Signal/src/views/OWSSystemMessageCell.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Signal/src/views/OWSSystemMessageCell.m b/Signal/src/views/OWSSystemMessageCell.m index 3e41ec11e..65d71f4dd 100644 --- a/Signal/src/views/OWSSystemMessageCell.m +++ b/Signal/src/views/OWSSystemMessageCell.m @@ -263,12 +263,16 @@ NS_ASSUME_NONNULL_BEGIN CGFloat topLabelSpacing = topLabelSize.height; - self.imageView.frame = CGRectMake(round((self.contentView.width - contentWidth) * 0.5f), + CGFloat contentLeft = round((self.contentView.width - contentWidth) * 0.5f); + CGFloat imageLeft = ([self isRTL] ? round(contentLeft + contentWidth - [self iconSize]) : contentLeft); + CGFloat titleLeft = ([self isRTL] ? contentLeft : round(imageLeft + [self iconSize] + [self hSpacing])); + + self.imageView.frame = CGRectMake(imageLeft, round((self.contentView.height - [self iconSize] + topLabelSpacing) * 0.5f), [self iconSize], [self iconSize]); - self.titleLabel.frame = CGRectMake(round(self.imageView.right + [self hSpacing]), + self.titleLabel.frame = CGRectMake(titleLeft, round((self.contentView.height - titleSize.height + topLabelSpacing) * 0.5f), ceil(titleSize.width + 1.f), ceil(titleSize.height + 1.f));