From 71787640ceb0af3b3f6b2e8ddddb5a662d710330 Mon Sep 17 00:00:00 2001 From: Sabrina Tardio Date: Thu, 22 Feb 2024 10:51:23 +0100 Subject: [PATCH 1/3] fix autofill UI for long copy --- .../View/PasswordManagementItemList.swift | 4 +- .../View/PasswordManager.storyboard | 82 ++++++++++--------- .../View/SaveCredentialsViewController.swift | 13 +++ 3 files changed, 60 insertions(+), 39 deletions(-) diff --git a/DuckDuckGo/SecureVault/View/PasswordManagementItemList.swift b/DuckDuckGo/SecureVault/View/PasswordManagementItemList.swift index c717288450..40b90f1d46 100644 --- a/DuckDuckGo/SecureVault/View/PasswordManagementItemList.swift +++ b/DuckDuckGo/SecureVault/View/PasswordManagementItemList.swift @@ -123,7 +123,7 @@ struct PasswordManagementItemListCategoryView: View { return 11 } - Spacer() +// Spacer() // MenuButton incorrectly displays a disabled state when you re-render it with a different image. // According to Stack Overflow, this was fixed in macOS 12, but it can still be reproduced on 12.2. @@ -135,8 +135,10 @@ struct PasswordManagementItemListCategoryView: View { if model.sortDescriptor.order == .ascending { PasswordManagementSortButton(imageName: "SortAscending") + .frame(width: 24) } else { PasswordManagementSortButton(imageName: "SortDescending") + .frame(width: 24) } } .padding(.vertical, -4) diff --git a/DuckDuckGo/SecureVault/View/PasswordManager.storyboard b/DuckDuckGo/SecureVault/View/PasswordManager.storyboard index 9435721706..19cb67b9d2 100644 --- a/DuckDuckGo/SecureVault/View/PasswordManager.storyboard +++ b/DuckDuckGo/SecureVault/View/PasswordManager.storyboard @@ -11,21 +11,21 @@ - + - + - + - + - + @@ -36,15 +36,15 @@ - + - + - + @@ -112,7 +112,7 @@ - + @@ -179,20 +179,20 @@ - + - + - + - + - + @@ -238,7 +238,7 @@ - + @@ -246,18 +246,18 @@ - + - + - + - - + + @@ -324,7 +324,7 @@ - + @@ -402,7 +402,7 @@ - + @@ -422,8 +422,8 @@ - - + + @@ -482,8 +482,8 @@ - - + + @@ -491,6 +491,8 @@ + + @@ -622,12 +624,12 @@ DQ - @@ -946,8 +949,11 @@ DQ - - + + + + + @@ -1056,7 +1062,7 @@ DQ - + diff --git a/DuckDuckGo/SecureVault/View/SaveCredentialsViewController.swift b/DuckDuckGo/SecureVault/View/SaveCredentialsViewController.swift index 2f6fbd8601..933a5f9531 100644 --- a/DuckDuckGo/SecureVault/View/SaveCredentialsViewController.swift +++ b/DuckDuckGo/SecureVault/View/SaveCredentialsViewController.swift @@ -108,6 +108,10 @@ final class SaveCredentialsViewController: NSViewController { fireproofCheckDescription.title = UserText.passwordManagementSaveCredentialsFireproofCheckboxDescription saveButton.title = UserText.save notNowSegmentedControl.setLabel(UserText.dontSave, forSegment: 0) + let fontAttributes = [NSAttributedString.Key.font: NSFont.systemFont(ofSize: NSFont.systemFontSize)] + let titleSize = (UserText.dontSave as NSString).size(withAttributes: fontAttributes) + notNowSegmentedControl.setWidth(titleSize.width + 16, forSegment: 0) + notNowSegmentedControl.setLabel(UserText.dontSave, forSegment: 0) updateButton.title = UserText.update openPasswordManagerButton.title = UserText.bitwardenPreferencesOpenBitwarden dontUpdateButton.title = UserText.dontUpdate @@ -170,6 +174,15 @@ final class SaveCredentialsViewController: NSViewController { titleLabel.stringValue = UserText.pmSaveCredentialsNonEditableTitle view.window?.makeFirstResponder(nil) } + let trailingToOpenPasswordConstraint = passwordManagerNotNowButton.trailingAnchor.constraint(equalTo: openPasswordManagerButton.leadingAnchor, constant: -12) + let trailingToSaveButtonConstraint = passwordManagerNotNowButton.trailingAnchor.constraint(equalTo: saveButton.leadingAnchor, constant: -12) + if openPasswordManagerButton.isHidden { + trailingToOpenPasswordConstraint.isActive = false + trailingToSaveButtonConstraint.isActive = true + } else { + trailingToSaveButtonConstraint.isActive = false + trailingToOpenPasswordConstraint.isActive = true + } } private func updateSaveSegmentedControl() { From a7e0567c34e1cab440da28adc93d9b7ae694ab3c Mon Sep 17 00:00:00 2001 From: Sabrina Tardio Date: Mon, 26 Feb 2024 12:27:40 +0100 Subject: [PATCH 2/3] fix some more constraints --- .../View/PasswordManager.storyboard | 12 ++++-------- .../View/SaveCredentialsViewController.swift | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/DuckDuckGo/SecureVault/View/PasswordManager.storyboard b/DuckDuckGo/SecureVault/View/PasswordManager.storyboard index 19cb67b9d2..efa488a53a 100644 --- a/DuckDuckGo/SecureVault/View/PasswordManager.storyboard +++ b/DuckDuckGo/SecureVault/View/PasswordManager.storyboard @@ -609,7 +609,7 @@