diff --git a/ChatSecure.xcodeproj/project.pbxproj b/ChatSecure.xcodeproj/project.pbxproj index 62e22b9bf..275fe4157 100644 --- a/ChatSecure.xcodeproj/project.pbxproj +++ b/ChatSecure.xcodeproj/project.pbxproj @@ -3112,7 +3112,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 163; + CURRENT_PROJECT_VERSION = 165; DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = NO; @@ -3150,7 +3150,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 163; + CURRENT_PROJECT_VERSION = 165; DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; @@ -3296,7 +3296,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 163; + CURRENT_PROJECT_VERSION = 165; DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = NO; @@ -3486,7 +3486,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 163; + CURRENT_PROJECT_VERSION = 165; DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; diff --git a/ChatSecureCore/Classes/View Controllers/OTRComposeGroupViewController.swift b/ChatSecureCore/Classes/View Controllers/OTRComposeGroupViewController.swift index 52c246c19..e2e34399d 100644 --- a/ChatSecureCore/Classes/View Controllers/OTRComposeGroupViewController.swift +++ b/ChatSecureCore/Classes/View Controllers/OTRComposeGroupViewController.swift @@ -164,9 +164,9 @@ open class OTRComposeGroupViewController: UIViewController, UICollectionViewDele if existingItems.contains(threadOwner.uniqueId) { isExistingOccupant = true } - cell.nameLabel.textColor = isExistingOccupant ? UIColor.gray : UIColor.black - cell.accountLabel.textColor = isExistingOccupant ? UIColor.gray : UIColor.black - cell.identifierLabel.textColor = isExistingOccupant ? UIColor.gray : UIColor.black + cell.nameLabel.textColor = isExistingOccupant ? OTRBuddyInfoCell.subtitleTextColor : OTRBuddyInfoCell.primaryTextColor + cell.accountLabel.textColor = isExistingOccupant ? OTRBuddyInfoCell.subtitleTextColor : OTRBuddyInfoCell.primaryTextColor + cell.identifierLabel.textColor = isExistingOccupant ? OTRBuddyInfoCell.subtitleTextColor : OTRBuddyInfoCell.primaryTextColor return cell } return UITableViewCell() diff --git a/ChatSecureCore/Classes/View Controllers/OTRNewBuddyViewController.m b/ChatSecureCore/Classes/View Controllers/OTRNewBuddyViewController.m index e800a3dfd..23938d4ae 100644 --- a/ChatSecureCore/Classes/View Controllers/OTRNewBuddyViewController.m +++ b/ChatSecureCore/Classes/View Controllers/OTRNewBuddyViewController.m @@ -66,12 +66,13 @@ - (void)viewDidLoad self.title = ADD_BUDDY_STRING(); - //self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelButtonPressed:)]; - - - UIBarButtonItem *qrButton = [[UIBarButtonItem alloc] initWithTitle:QR_CODE_STRING() style:UIBarButtonItemStylePlain target:self action:@selector(qrButtonPressed:)]; UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(doneButtonPressed:)]; - self.navigationItem.rightBarButtonItems = @[doneButton, qrButton]; + NSMutableArray *rightBarButtonItems = @[doneButton].mutableCopy; + if ([QRCodeReader isAvailable]) { + UIBarButtonItem *qrButton = [[UIBarButtonItem alloc] initWithTitle:QR_CODE_STRING() style:UIBarButtonItemStylePlain target:self action:@selector(qrButtonPressed:)]; + [rightBarButtonItems insertObject:qrButton atIndex:0]; + } + self.navigationItem.rightBarButtonItems = rightBarButtonItems; self.accountNameTextField = [[UITextField alloc] initWithFrame:CGRectZero]; self.accountNameTextField.placeholder = XMPP_USERNAME_EXAMPLE_STRING(); diff --git a/ChatSecureCore/Classes/Views/Cells/OTRBuddyInfoCell.m b/ChatSecureCore/Classes/Views/Cells/OTRBuddyInfoCell.m index f7857e00b..58e2ae14d 100644 --- a/ChatSecureCore/Classes/Views/Cells/OTRBuddyInfoCell.m +++ b/ChatSecureCore/Classes/Views/Cells/OTRBuddyInfoCell.m @@ -23,14 +23,11 @@ @interface OTRBuddyInfoCell () @property (nonatomic, strong) UILabel *identifierLabel; @property (nonatomic, strong) UILabel *accountLabel; -@property (nonatomic, strong, readonly) UIColor *primaryTextColor; -@property (nonatomic, strong, readonly) UIColor *subtitleTextColor; - @end @implementation OTRBuddyInfoCell -- (UIColor *) primaryTextColor { ++ (UIColor *) primaryTextColor { if (@available(iOS 13.0, *)) { return [UIColor labelColor]; } else { @@ -38,7 +35,7 @@ - (UIColor *) primaryTextColor { } } -- (UIColor *) subtitleTextColor { ++ (UIColor *) subtitleTextColor { if (@available(iOS 13.0, *)) { return [UIColor systemGray3Color]; } else { @@ -53,11 +50,11 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus self.nameLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; self.identifierLabel = [[UILabel alloc] initForAutoLayout]; - self.identifierLabel.textColor = self.primaryTextColor; + self.identifierLabel.textColor = self.class.primaryTextColor; self.identifierLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption1]; self.accountLabel = [[UILabel alloc] initForAutoLayout]; - self.accountLabel.textColor = self.subtitleTextColor; + self.accountLabel.textColor = self.class.subtitleTextColor; self.accountLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption2]; NSArray *labels = @[self.nameLabel, self.identifierLabel, self.accountLabel]; @@ -93,9 +90,9 @@ - (void)setThread:(id)thread account:(nullable OTRAccount*)accou } self.identifierLabel.text = identifier; - UIColor *textColor = self.primaryTextColor; + UIColor *textColor = self.class.primaryTextColor; if ([thread isArchived]) { - textColor = self.subtitleTextColor; + textColor = self.class.subtitleTextColor; } [@[self.nameLabel, self.identifierLabel] enumerateObjectsUsingBlock:^(UILabel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { obj.textColor = textColor; @@ -126,9 +123,9 @@ - (void)updateConstraints - (void)prepareForReuse { [super prepareForReuse]; - self.nameLabel.textColor = self.primaryTextColor; - self.identifierLabel.textColor = self.primaryTextColor; - self.accountLabel.textColor = self.subtitleTextColor; + self.nameLabel.textColor = self.class.primaryTextColor; + self.identifierLabel.textColor = self.class.primaryTextColor; + self.accountLabel.textColor = self.class.subtitleTextColor; } - (void) infoButtonPressed:(UIButton*)sender { diff --git a/ChatSecureCore/Public/OTRBuddyInfoCell.h b/ChatSecureCore/Public/OTRBuddyInfoCell.h index 0c06d1a9b..6aad4dae0 100644 --- a/ChatSecureCore/Public/OTRBuddyInfoCell.h +++ b/ChatSecureCore/Public/OTRBuddyInfoCell.h @@ -27,6 +27,8 @@ extern const CGFloat OTRBuddyInfoCellHeight; /** Action callback for infoButton */ @property (nonatomic, copy, nullable) void (^infoAction)(OTRBuddyInfoCell *cell, UIButton *sender); +@property (class, nonatomic, strong, readonly) UIColor *primaryTextColor; +@property (class, nonatomic, strong, readonly) UIColor *subtitleTextColor; @end NS_ASSUME_NONNULL_END diff --git a/OTRResources/Interface/OTRComposeGroup.storyboard b/OTRResources/Interface/OTRComposeGroup.storyboard index f29ce111c..29b8c7718 100644 --- a/OTRResources/Interface/OTRComposeGroup.storyboard +++ b/OTRResources/Interface/OTRComposeGroup.storyboard @@ -1,11 +1,9 @@ - - - - + + - + @@ -22,7 +20,7 @@ - + @@ -30,7 +28,7 @@ - + @@ -54,7 +52,7 @@ - + @@ -71,7 +69,7 @@ - + diff --git a/OTRResources/Interface/OTRComposeGroupBuddyCell.xib b/OTRResources/Interface/OTRComposeGroupBuddyCell.xib index a87fb71de..42ba42a0f 100644 --- a/OTRResources/Interface/OTRComposeGroupBuddyCell.xib +++ b/OTRResources/Interface/OTRComposeGroupBuddyCell.xib @@ -1,11 +1,9 @@ - - - - + + - + @@ -26,13 +24,12 @@ - + @@ -61,6 +58,7 @@ +