-
Notifications
You must be signed in to change notification settings - Fork 9
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
modify manage bookmarks button #1175
modify manage bookmarks button #1175
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of minor things to address, but otherwise looks good.
manageBookmarksButton.imageHugsTitle = true | ||
|
||
// Set up constraints | ||
let titleWidth = (CGFloat(manageBookmarksButton.title.count - 1) * 7.0 + 9) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than hardcoding those magic numbers you could just calculate the width like this:
let titleWidth = (CGFloat(manageBookmarksButton.title.count - 1) * 7.0 + 9) | |
let titleWidth = (manageBookmarksButton.title as NSString).size(withAttributes: [.font: manageBookmarksButton.font as Any]).width |
let buttonWidth = imageSize.width + titleWidth + padding * 3 | ||
manageBookmarksButton.translatesAutoresizingMaskIntoConstraints = false | ||
let widthConstraint = NSLayoutConstraint(item: manageBookmarksButton!, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: buttonWidth) | ||
let heightConstraint = NSLayoutConstraint(item: manageBookmarksButton!, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 28) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The height constraint isn't needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is needed for the padding on hover. It was set on the storyboard but since we are trying to step away from them I thought moving the constraint in code was a teeeeeeny step towards that
* release/1.39.0: Set version to 1.39.0 Update embedded files Update old Dax asset (#1193) WebKit find in page (#1188) modify manage bookmarks button (#1175) sync update device model / poll for devices (#1191) Fix creating DMG images in GitHub Actions (#1185) Update Privacy Dashboard info on redirect (#1186) Update BSK with autofill 6.5.1 (#1182) Only use LazyVStack on home page when on macos 12 or higher (#1181) Update PULL_REQUEST_TEMPLATE.md (#1173) Sabrina/allow tabs in single tab windows to be moved to other windows (#1174) Version 1.38.1 Version 1.38.0 Embeded files updated Remove the Fire button pixel (#1151) remove duck player pixels (#1176) Adding a mitigation for youtube-nocookie storing data in localStorage (#1172) fix bug where pasting url into address bar clears its content (#1166)
* upstream_develop: sync device connected names (#1205) Autofill/subdomain matching (#1122) add-windows-browser-download-link-privacy-config (#1198) Update metadata Fix creating DMG from release workflow (#1200) Unit tests to cover sensitive areas of Burner Window (#1169) [Hackdays] Share via QR Code (#1177) Fix sync connect flow (#1195) Update to BSK adding new remote message image (#1194) Set version to 1.39.0 Update embedded files Update old Dax asset (#1193) WebKit find in page (#1188) modify manage bookmarks button (#1175) sync update device model / poll for devices (#1191)
Task/Issue URL: https://app.asana.com/0/1177771139624306/1204110808978984/f
Description: Modify the button to open the bookmarks management page
Steps to test this PR:
Internal references:
Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
When ready for review, remember to post the PR in MM