Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix FXIOS-10678 - [Toolbar Redesign] Add 8dp padding on the right of the URL #23505

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class BrowserAddressToolbar: UIView,
LocationViewDelegate,
UIDragInteractionDelegate {
private enum UX {
static let horizontalEdgeSpace: CGFloat = 16
static let verticalEdgeSpace: CGFloat = 8
static let horizontalSpace: CGFloat = 8
static let cornerRadius: CGFloat = 8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ final class LocationView: UIView,
guard let text = urlTextField.text, let font = urlTextField.font else {
return false
}
let locationViewWidth = frame.width - (UX.horizontalSpace * 2)
let fontAttributes = [NSAttributedString.Key.font: font]
let urlTextFieldWidth = text.size(withAttributes: fontAttributes).width
return urlTextFieldWidth >= locationViewWidth
let locationViewVisibleWidth = frame.width - iconContainerStackView.frame.width - UX.horizontalSpace
let urlTextFieldWidth = text.size(withAttributes: [.font: font]).width

return urlTextFieldWidth >= locationViewVisibleWidth
}

private var dotWidth: CGFloat {
Expand Down Expand Up @@ -173,7 +173,7 @@ final class LocationView: UIView,

urlTextField.topAnchor.constraint(equalTo: topAnchor),
urlTextField.bottomAnchor.constraint(equalTo: bottomAnchor),
urlTextField.trailingAnchor.constraint(equalTo: trailingAnchor),
urlTextField.trailingAnchor.constraint(equalTo: trailingAnchor, constant: UX.horizontalSpace),

iconContainerBackgroundView.topAnchor.constraint(equalTo: urlTextField.topAnchor),
iconContainerBackgroundView.bottomAnchor.constraint(equalTo: urlTextField.bottomAnchor),
Expand Down