From 42a0a8890ccba431ea2bb05835aee5b4931d50ea Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 17 Nov 2019 11:33:49 -0500 Subject: [PATCH] Tweak profile header more button appearance --- .../ProfileHeaderTableViewCell.swift | 9 ++- .../ProfileHeaderTableViewCell.xib | 64 ++++++++++++++----- 2 files changed, 56 insertions(+), 17 deletions(-) diff --git a/Tusker/Views/Profile Header/ProfileHeaderTableViewCell.swift b/Tusker/Views/Profile Header/ProfileHeaderTableViewCell.swift index 3d9fdda4b5..0d8edaa7e4 100644 --- a/Tusker/Views/Profile Header/ProfileHeaderTableViewCell.swift +++ b/Tusker/Views/Profile Header/ProfileHeaderTableViewCell.swift @@ -27,6 +27,7 @@ class ProfileHeaderTableViewCell: UITableViewCell { @IBOutlet weak var fieldsStackView: UIStackView! @IBOutlet weak var fieldNamesStackView: UIStackView! @IBOutlet weak var fieldValuesStack: UIStackView! + @IBOutlet weak var moreButtonVisualEffectView: UIVisualEffectView! var accountID: String! @@ -40,6 +41,12 @@ class ProfileHeaderTableViewCell: UITableViewCell { avatarImageView.isUserInteractionEnabled = true headerImageView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(headerPressed))) headerImageView.isUserInteractionEnabled = true + moreButtonVisualEffectView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(morePressed))) + + let maskLayer = CAShapeLayer() + maskLayer.frame = moreButtonVisualEffectView.bounds + maskLayer.path = CGPath(ellipseIn: moreButtonVisualEffectView.bounds, transform: nil) + moreButtonVisualEffectView.layer.mask = maskLayer NotificationCenter.default.addObserver(self, selector: #selector(updateUIForPreferences), name: .preferencesChanged, object: nil) } @@ -129,7 +136,7 @@ class ProfileHeaderTableViewCell: UITableViewCell { } } - @IBAction func morePressed(_ sender: Any) { + @objc func morePressed() { delegate?.showMoreOptions() } diff --git a/Tusker/Views/Profile Header/ProfileHeaderTableViewCell.xib b/Tusker/Views/Profile Header/ProfileHeaderTableViewCell.xib index b7ba042f6c..a34c2b7a46 100644 --- a/Tusker/Views/Profile Header/ProfileHeaderTableViewCell.xib +++ b/Tusker/Views/Profile Header/ProfileHeaderTableViewCell.xib @@ -1,8 +1,8 @@ - + - + @@ -85,18 +85,49 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -110,6 +141,7 @@ + @@ -118,9 +150,8 @@ - - + @@ -133,6 +164,7 @@ +