From d3e3c9d720a3b9b90f5aa4bbddfc37cd17435630 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Sat, 3 Jun 2017 11:57:41 -0400 Subject: [PATCH] Fixes #174 - Login name copy button was made inoperative when hint was hidden. --- platform-darwin/Source/iOS/MPSiteCell.m | 9 ++--- .../Source/iOS/Storyboard.storyboard | 36 +++++++++++-------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/platform-darwin/Source/iOS/MPSiteCell.m b/platform-darwin/Source/iOS/MPSiteCell.m index 4eeb6c1a..c41d0b6d 100644 --- a/platform-darwin/Source/iOS/MPSiteCell.m +++ b/platform-darwin/Source/iOS/MPSiteCell.m @@ -38,6 +38,7 @@ @property(nonatomic, strong) IBOutlet UIScrollView *modeScrollView; @property(nonatomic, strong) IBOutlet UIButton *contentButton; @property(nonatomic, strong) IBOutlet UIButton *loginNameButton; +@property(nonatomic, strong) IBOutlet UILabel *loginNameHint; @property(nonatomic, strong) IBOutlet UIView *indicatorView; @property(nonatomic) MPSiteCellMode mode; @@ -198,7 +199,7 @@ atScrollPosition:UICollectionViewScrollPositionCenteredVertically animated:YES]; if (textField == self.loginNameField) - self.loginNameButton.hidden = [self.loginNameField.attributedText length] || self.loginNameField.enabled; + self.loginNameHint.hidden = [self.loginNameField.attributedText length] || self.loginNameField.enabled; } - (IBAction)textFieldDidChange:(UITextField *)textField { @@ -546,9 +547,9 @@ [self.passwordField resignFirstResponder]; } if ([[MPiOSAppDelegate get] isFeatureUnlocked:MPProductGenerateLogins]) - [self.loginNameButton setTitle:@"Tap here to ⚙ generate username or the pencil to type one" forState:UIControlStateNormal]; + self.loginNameHint.text = @"Tap here to ⚙ generate username or the pencil to type one"; else - [self.loginNameButton setTitle:@"Tap the pencil to type a username" forState:UIControlStateNormal]; + self.loginNameHint.text = @"Tap the pencil to type a username"; // Site Name [self updateSiteName:mainSite]; @@ -607,7 +608,7 @@ self.loginNameGenerated.hidden = !loginGenerated; self.loginNameField.attributedText = strarm( stra( loginName?: @"", self.siteNameLabel.textAttributes ), NSParagraphStyleAttributeName, nil ); - self.loginNameButton.hidden = [loginName length] || self.loginNameField.enabled; + self.loginNameHint.hidden = [loginName length] || self.loginNameField.enabled; if (![password length]) { self.indicatorView.hidden = NO; diff --git a/platform-darwin/Source/iOS/Storyboard.storyboard b/platform-darwin/Source/iOS/Storyboard.storyboard index 31e785a9..1a8a73aa 100644 --- a/platform-darwin/Source/iOS/Storyboard.storyboard +++ b/platform-darwin/Source/iOS/Storyboard.storyboard @@ -1,5 +1,5 @@ - + @@ -103,7 +103,7 @@ - + - -