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

modify manage bookmarks button #1175

Merged
merged 3 commits into from
May 11, 2023

Conversation

SabrinaTardio
Copy link
Collaborator

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:

  1. In the more option menu -> open bookmarks panel, check the button to open the management has the required icon and the text Manage (see Asana task)

Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
When ready for review, remember to post the PR in MM

@SabrinaTardio SabrinaTardio requested review from a team and brindy and removed request for a team May 3, 2023 07:36
Copy link
Contributor

@brindy brindy left a 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)
Copy link
Contributor

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:

Suggested change
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)
Copy link
Contributor

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.

Copy link
Collaborator Author

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

@brindy brindy assigned SabrinaTardio and unassigned brindy May 10, 2023
@SabrinaTardio SabrinaTardio merged commit 65cedbd into develop May 11, 2023
@SabrinaTardio SabrinaTardio deleted the sabrina/update-manage-bookmarks-button branch May 11, 2023 07:19
samsymons added a commit that referenced this pull request May 12, 2023
* 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)
samsymons added a commit that referenced this pull request May 23, 2023
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants