Compare commits
No commits in common. "ee651ae96a193f1307eaef4397a921a75a571bbf" and "8f6a0125380ed47dfa87ccb24a24ecaf08eaf4de" have entirely different histories.
ee651ae96a
...
8f6a012538
|
@ -120,8 +120,8 @@ class PollController: ViewController {
|
|||
}
|
||||
.padding(8)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 10, style: .continuous)
|
||||
.foregroundColor(backgroundColor)
|
||||
backgroundColor
|
||||
.cornerRadius(10)
|
||||
)
|
||||
.onChange(of: controller.duration) { newValue in
|
||||
poll.duration = newValue.timeInterval
|
||||
|
|
|
@ -155,7 +155,6 @@ public class DuckableContainerViewController: UIViewController, DuckableViewCont
|
|||
bottomConstraint.isActive = true
|
||||
|
||||
child.view.layer.cornerRadius = duckedCornerRadius
|
||||
child.view.layer.cornerCurve = .continuous
|
||||
child.view.layer.maskedCorners = [.layerMinXMaxYCorner, .layerMaxXMaxYCorner]
|
||||
child.view.layer.masksToBounds = true
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ public struct AvatarImageView: View {
|
|||
imageView
|
||||
.resizable()
|
||||
.frame(width: size, height: size)
|
||||
.clipShape(RoundedRectangle(cornerRadius: style.cornerRadiusFraction * size, style: .continuous))
|
||||
.cornerRadius(style.cornerRadiusFraction * size)
|
||||
.task { @MainActor in
|
||||
image = nil
|
||||
if let url {
|
||||
|
|
|
@ -27,9 +27,7 @@ class FeaturedProfileCollectionViewCell: UICollectionViewCell {
|
|||
super.awakeFromNib()
|
||||
|
||||
avatarContainerView.layer.cornerRadius = Preferences.shared.avatarStyle.cornerRadius(for: avatarContainerView)
|
||||
avatarContainerView.layer.cornerCurve = .continuous
|
||||
avatarImageView.layer.cornerRadius = Preferences.shared.avatarStyle.cornerRadius(for: avatarImageView)
|
||||
avatarImageView.layer.cornerCurve = .continuous
|
||||
|
||||
displayNameLabel.font = UIFontMetrics(forTextStyle: .title1).scaledFont(for: .systemFont(ofSize: 20, weight: .semibold))
|
||||
displayNameLabel.adjustsFontForContentSizeCategory = true
|
||||
|
@ -43,7 +41,6 @@ class FeaturedProfileCollectionViewCell: UICollectionViewCell {
|
|||
backgroundColor = .clear
|
||||
clippingView.backgroundColor = .appBackground
|
||||
clippingView.layer.cornerRadius = 5
|
||||
clippingView.layer.cornerCurve = .continuous
|
||||
clippingView.layer.borderWidth = 1
|
||||
clippingView.layer.masksToBounds = true
|
||||
layer.shadowOpacity = 0.2
|
||||
|
|
|
@ -36,17 +36,14 @@ class SuggestedProfileCardCollectionViewCell: UICollectionViewCell {
|
|||
layer.shadowOffset = .zero
|
||||
layer.masksToBounds = false
|
||||
contentView.layer.cornerRadius = 12.5
|
||||
contentView.layer.cornerCurve = .continuous
|
||||
contentView.backgroundColor = .appGroupedCellBackground
|
||||
updateLayerColors()
|
||||
|
||||
headerImageView.cache = .headers
|
||||
|
||||
avatarContainerView.layer.masksToBounds = true
|
||||
avatarContainerView.layer.cornerCurve = .continuous
|
||||
avatarImageView.cache = .avatars
|
||||
avatarImageView.layer.masksToBounds = true
|
||||
avatarImageView.layer.cornerCurve = .continuous
|
||||
|
||||
displayNameLabel.font = UIFontMetrics(forTextStyle: .title1).scaledFont(for: .systemFont(ofSize: 24, weight: .semibold))
|
||||
displayNameLabel.adjustsFontForContentSizeCategory = true
|
||||
|
|
|
@ -57,7 +57,6 @@ class TrendingLinkCardCollectionViewCell: UICollectionViewCell {
|
|||
layer.shadowOffset = .zero
|
||||
layer.masksToBounds = false
|
||||
contentView.layer.cornerRadius = 12.5
|
||||
contentView.layer.cornerCurve = .continuous
|
||||
contentView.backgroundColor = .appGroupedCellBackground
|
||||
updateLayerColors()
|
||||
|
||||
|
|
|
@ -86,9 +86,7 @@ class FastSwitchingAccountView: UIView {
|
|||
avatarImageView.translatesAutoresizingMaskIntoConstraints = false
|
||||
avatarImageView.layer.masksToBounds = true
|
||||
avatarImageView.layer.cornerRadius = Preferences.shared.avatarStyle.cornerRadiusFraction * 40
|
||||
avatarImageView.layer.cornerCurve = .continuous
|
||||
avatarImageView.image = UIImage(systemName: Preferences.shared.avatarStyle == .circle ? "person.crop.circle" : "person.crop.square")
|
||||
// todo: this should really be fit, but somehow the image view ends up being 37pt tall?
|
||||
avatarImageView.contentMode = .scaleAspectFill
|
||||
addSubview(avatarImageView)
|
||||
|
||||
|
|
|
@ -225,7 +225,6 @@ extension MainSplitViewController: UISplitViewControllerDelegate {
|
|||
// so that explore items aren't shown multiple times.
|
||||
|
||||
let exploreNav = tabBarViewController.viewController(for: .explore) as! UINavigationController
|
||||
// make sure there's a root ExploreViewController
|
||||
let explore: ExploreViewController
|
||||
if let existing = exploreNav.viewControllers.first as? ExploreViewController {
|
||||
explore = existing
|
||||
|
@ -239,7 +238,6 @@ extension MainSplitViewController: UISplitViewControllerDelegate {
|
|||
explore.loadViewIfNeeded()
|
||||
|
||||
let search = secondaryNavController.viewControllers.first as! InlineTrendsViewController
|
||||
if search.searchController.isActive {
|
||||
// Copy the search query from the search VC to the Explore VC's search controller.
|
||||
let query = search.searchController.searchBar.text ?? ""
|
||||
explore.searchController.searchBar.text = query
|
||||
|
@ -248,14 +246,6 @@ extension MainSplitViewController: UISplitViewControllerDelegate {
|
|||
explore.searchControllerStatusOnAppearance = !query.isEmpty
|
||||
// Copy the results from the search VC's results controller to avoid the delay introduced by an extra network request
|
||||
explore.resultsController.loadResults(from: search.resultsController)
|
||||
} else {
|
||||
// if there is more than just the InlineTrendsVC, and the search VC is not active,
|
||||
// then the user selected something from the trends screen
|
||||
if secondaryNavController.viewControllers.count >= 2 {
|
||||
// make sure there's a corresponding trends VC in the collapsed nav that they can go back to
|
||||
exploreNav.pushViewController(TrendsViewController(mastodonController: mastodonController), animated: false)
|
||||
}
|
||||
}
|
||||
|
||||
// Transfer the navigation stack, dropping the search VC, to keep anything the user has opened
|
||||
transferNavigationStack(from: .explore, to: exploreNav, dropFirst: true, append: true)
|
||||
|
@ -339,16 +329,14 @@ extension MainSplitViewController: UISplitViewControllerDelegate {
|
|||
exploreItem = .favorites
|
||||
case let listVC as ListTimelineViewController:
|
||||
exploreItem = .list(listVC.list)
|
||||
case let hashtagVC as HashtagTimelineViewController where hashtagVC.isHashtagSaved:
|
||||
case let hashtagVC as HashtagTimelineViewController:
|
||||
exploreItem = .savedHashtag(hashtagVC.hashtag)
|
||||
case let instanceVC as InstanceTimelineViewController:
|
||||
exploreItem = .savedInstance(instanceVC.instanceURL)
|
||||
case is TrendsViewController:
|
||||
case is TrendingStatusesViewController, is TrendingHashtagsViewController, is TrendingLinksViewController:
|
||||
exploreItem = .explore
|
||||
// skip transferring the ExploreViewController and TrendsViewController
|
||||
// these three VCs are part of the root SearchViewController, so we don't need to transfer them
|
||||
skipFirst = 2
|
||||
// prepend the InlineTrendsViewController
|
||||
toPrepend = getOrCreateNavigationStack(item: .explore).first!
|
||||
default:
|
||||
// transfer the navigation stack prepending, the existing explore VC
|
||||
// if there was other stuff on the explore stack, it will get discarded
|
||||
|
|
|
@ -149,7 +149,6 @@ class ActionNotificationGroupCollectionViewCell: UICollectionViewListCell {
|
|||
imageView.contentMode = .scaleAspectFit
|
||||
imageView.layer.masksToBounds = true
|
||||
imageView.layer.cornerRadius = Preferences.shared.avatarStyle.cornerRadiusFraction * 30
|
||||
imageView.layer.cornerCurve = .continuous
|
||||
avatarStack.addArrangedSubview(imageView)
|
||||
imageView.update(for: avatarURL)
|
||||
}
|
||||
|
|
|
@ -123,7 +123,6 @@ class FollowNotificationGroupCollectionViewCell: UICollectionViewListCell {
|
|||
let imageView = CachedImageView(cache: .avatars)
|
||||
imageView.layer.masksToBounds = true
|
||||
imageView.layer.cornerRadius = Preferences.shared.avatarStyle.cornerRadiusFraction * 30
|
||||
imageView.layer.cornerCurve = .continuous
|
||||
imageView.update(for: avatarURL)
|
||||
avatarStack.addArrangedSubview(imageView)
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ class FollowRequestNotificationCollectionViewCell: UICollectionViewListCell {
|
|||
|
||||
private let avatarImageView = CachedImageView(cache: .avatars).configure {
|
||||
$0.layer.masksToBounds = true
|
||||
$0.layer.cornerCurve = .continuous
|
||||
NSLayoutConstraint.activate([
|
||||
$0.widthAnchor.constraint(equalTo: $0.heightAnchor),
|
||||
])
|
||||
|
|
|
@ -15,7 +15,7 @@ class HashtagTimelineViewController: TimelineViewController {
|
|||
|
||||
var toggleSaveButton: UIBarButtonItem!
|
||||
|
||||
var isHashtagSaved: Bool {
|
||||
private var isHashtagSaved: Bool {
|
||||
let req = SavedHashtag.fetchRequest(name: hashtag.name, account: mastodonController.accountInfo!)
|
||||
return mastodonController.persistentContainer.viewContext.objectExists(for: req)
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ class AccountCollectionViewCell: UICollectionViewListCell {
|
|||
|
||||
private let avatarImageView = CachedImageView(cache: .avatars).configure {
|
||||
$0.layer.masksToBounds = true
|
||||
$0.layer.cornerCurve = .continuous
|
||||
NSLayoutConstraint.activate([
|
||||
$0.widthAnchor.constraint(equalToConstant: 50),
|
||||
$0.heightAnchor.constraint(equalToConstant: 50),
|
||||
|
|
|
@ -28,7 +28,6 @@ class AccountTableViewCell: UITableViewCell {
|
|||
super.awakeFromNib()
|
||||
|
||||
avatarImageView.layer.masksToBounds = true
|
||||
avatarImageView.layer.cornerCurve = .continuous
|
||||
|
||||
usernameLabel.font = UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 15, weight: .light))
|
||||
usernameLabel.adjustsFontForContentSizeCategory = true
|
||||
|
|
|
@ -22,7 +22,6 @@ class LargeAccountDetailView: UIView {
|
|||
|
||||
avatarImageView.translatesAutoresizingMaskIntoConstraints = false
|
||||
avatarImageView.layer.masksToBounds = true
|
||||
avatarImageView.layer.cornerCurve = .continuous
|
||||
addSubview(avatarImageView)
|
||||
|
||||
displayNameLabel.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
|
|
@ -368,13 +368,11 @@ class AttachmentView: GIFImageView {
|
|||
let first = stack.arrangedSubviews.first!
|
||||
first.layer.masksToBounds = true
|
||||
first.layer.cornerRadius = 4
|
||||
first.layer.cornerCurve = .continuous
|
||||
if stack.arrangedSubviews.count > 1 {
|
||||
first.layer.maskedCorners = [.layerMinXMinYCorner, .layerMinXMaxYCorner]
|
||||
let last = stack.arrangedSubviews.last!
|
||||
last.layer.masksToBounds = true
|
||||
last.layer.cornerRadius = 4
|
||||
last.layer.cornerCurve = .continuous
|
||||
last.layer.maskedCorners = [.layerMaxXMinYCorner, .layerMaxXMaxYCorner]
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,6 @@ class AttachmentsContainerView: UIView {
|
|||
case 1:
|
||||
let attachmentView = createAttachmentView(index: 0, hSize: .full, vSize: .full)
|
||||
attachmentView.layer.cornerRadius = 5
|
||||
attachmentView.layer.cornerCurve = .continuous
|
||||
attachmentView.layer.masksToBounds = true
|
||||
fillView(attachmentView)
|
||||
sendSubviewToBack(attachmentView)
|
||||
|
@ -96,12 +95,10 @@ class AttachmentsContainerView: UIView {
|
|||
case 2:
|
||||
let left = createAttachmentView(index: 0, hSize: .half, vSize: .full)
|
||||
left.layer.cornerRadius = 5
|
||||
left.layer.cornerCurve = .continuous
|
||||
left.layer.maskedCorners = [.layerMinXMinYCorner, .layerMinXMaxYCorner]
|
||||
left.layer.masksToBounds = true
|
||||
let right = createAttachmentView(index: 1, hSize: .half, vSize: .full)
|
||||
right.layer.cornerRadius = 5
|
||||
right.layer.cornerCurve = .continuous
|
||||
right.layer.maskedCorners = [.layerMaxXMinYCorner, .layerMaxXMaxYCorner]
|
||||
right.layer.masksToBounds = true
|
||||
let stack = createAttachmentsStack(axis: .horizontal, arrangedSubviews: [
|
||||
|
@ -119,17 +116,14 @@ class AttachmentsContainerView: UIView {
|
|||
case 3:
|
||||
let left = createAttachmentView(index: 0, hSize: .half, vSize: .full)
|
||||
left.layer.cornerRadius = 5
|
||||
left.layer.cornerCurve = .continuous
|
||||
left.layer.maskedCorners = [.layerMinXMinYCorner, .layerMinXMaxYCorner]
|
||||
left.layer.masksToBounds = true
|
||||
let topRight = createAttachmentView(index: 1, hSize: .half, vSize: .half)
|
||||
topRight.layer.cornerRadius = 5
|
||||
topRight.layer.cornerCurve = .continuous
|
||||
topRight.layer.maskedCorners = .layerMaxXMinYCorner
|
||||
topRight.layer.masksToBounds = true
|
||||
let bottomRight = createAttachmentView(index: 2, hSize: .half, vSize: .half)
|
||||
bottomRight.layer.cornerRadius = 5
|
||||
bottomRight.layer.cornerCurve = .continuous
|
||||
bottomRight.layer.maskedCorners = .layerMaxXMaxYCorner
|
||||
bottomRight.layer.masksToBounds = true
|
||||
let innerStack = createAttachmentsStack(axis: .vertical, arrangedSubviews: [
|
||||
|
@ -154,12 +148,10 @@ class AttachmentsContainerView: UIView {
|
|||
case 4:
|
||||
let topLeft = createAttachmentView(index: 0, hSize: .half, vSize: .half)
|
||||
topLeft.layer.cornerRadius = 5
|
||||
topLeft.layer.cornerCurve = .continuous
|
||||
topLeft.layer.maskedCorners = .layerMinXMinYCorner
|
||||
topLeft.layer.masksToBounds = true
|
||||
let bottomLeft = createAttachmentView(index: 2, hSize: .half, vSize: .half)
|
||||
bottomLeft.layer.cornerRadius = 5
|
||||
bottomLeft.layer.cornerCurve = .continuous
|
||||
bottomLeft.layer.maskedCorners = .layerMinXMaxYCorner
|
||||
bottomLeft.layer.masksToBounds = true
|
||||
let left = createAttachmentsStack(axis: .vertical, arrangedSubviews: [
|
||||
|
@ -169,12 +161,10 @@ class AttachmentsContainerView: UIView {
|
|||
attachmentStacks.add(left)
|
||||
let topRight = createAttachmentView(index: 1, hSize: .half, vSize: .half)
|
||||
topRight.layer.cornerRadius = 5
|
||||
topRight.layer.cornerCurve = .continuous
|
||||
topRight.layer.maskedCorners = .layerMaxXMinYCorner
|
||||
topRight.layer.masksToBounds = true
|
||||
let bottomRight = createAttachmentView(index: 3, hSize: .half, vSize: .half)
|
||||
bottomRight.layer.cornerRadius = 5
|
||||
bottomRight.layer.cornerCurve = .continuous
|
||||
bottomRight.layer.maskedCorners = .layerMaxXMaxYCorner
|
||||
bottomRight.layer.masksToBounds = true
|
||||
let right = createAttachmentsStack(axis: .vertical, arrangedSubviews: [
|
||||
|
@ -206,7 +196,6 @@ class AttachmentsContainerView: UIView {
|
|||
moreView.isUserInteractionEnabled = true
|
||||
moreView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(moreViewTapped)))
|
||||
moreView.layer.cornerRadius = 5
|
||||
moreView.layer.cornerCurve = .continuous
|
||||
moreView.layer.maskedCorners = .layerMaxXMaxYCorner
|
||||
moreView.layer.masksToBounds = true
|
||||
let moreLabel = UILabel()
|
||||
|
@ -219,7 +208,6 @@ class AttachmentsContainerView: UIView {
|
|||
|
||||
let topLeft = createAttachmentView(index: 0, hSize: .half, vSize: .half)
|
||||
topLeft.layer.cornerRadius = 5
|
||||
topLeft.layer.cornerCurve = .continuous
|
||||
topLeft.layer.maskedCorners = .layerMinXMinYCorner
|
||||
topLeft.layer.masksToBounds = true
|
||||
let bottomLeft = createAttachmentView(index: 2, hSize: .half, vSize: .half)
|
||||
|
@ -233,7 +221,6 @@ class AttachmentsContainerView: UIView {
|
|||
attachmentStacks.add(left)
|
||||
let topRight = createAttachmentView(index: 1, hSize: .half, vSize: .half)
|
||||
topRight.layer.cornerRadius = 5
|
||||
topRight.layer.cornerCurve = .continuous
|
||||
topRight.layer.maskedCorners = .layerMaxXMinYCorner
|
||||
topRight.layer.masksToBounds = true
|
||||
let right = createAttachmentsStack(axis: .vertical, arrangedSubviews: [
|
||||
|
|
|
@ -35,7 +35,6 @@ class PollOptionCheckboxView: UIView {
|
|||
|
||||
let size: CGFloat = 20
|
||||
layer.cornerRadius = (multiple ? 0.1 : 0.5) * size
|
||||
layer.cornerCurve = .continuous
|
||||
layer.borderWidth = 2
|
||||
|
||||
imageView.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
|
|
@ -22,7 +22,6 @@ class PollOptionView: UIView {
|
|||
|
||||
let minHeight: CGFloat = 35
|
||||
layer.cornerRadius = 0.1 * minHeight
|
||||
layer.cornerCurve = .continuous
|
||||
backgroundColor = unselectedBackgroundColor
|
||||
|
||||
checkbox.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
@ -67,7 +66,6 @@ class PollOptionView: UIView {
|
|||
fillView.backgroundColor = .tintColor.withAlphaComponent(0.6)
|
||||
fillView.layer.zPosition = -1
|
||||
fillView.layer.cornerRadius = layer.cornerRadius
|
||||
fillView.layer.cornerCurve = .continuous
|
||||
addSubview(fillView)
|
||||
|
||||
NSLayoutConstraint.activate([
|
||||
|
|
|
@ -42,7 +42,6 @@ class ProfileHeaderMovedOverlayView: UIView {
|
|||
avatarImageView = CachedImageView(cache: .avatars)
|
||||
avatarImageView.layer.masksToBounds = true
|
||||
avatarImageView.layer.cornerRadius = Preferences.shared.avatarStyle.cornerRadiusFraction * 50
|
||||
avatarImageView.layer.cornerCurve = .continuous
|
||||
avatarImageView.addInteraction(UIPointerInteraction(delegate: self))
|
||||
avatarImageView.isUserInteractionEnabled = true
|
||||
|
||||
|
|
|
@ -66,9 +66,7 @@ class ProfileHeaderView: UIView {
|
|||
|
||||
avatarContainerView.backgroundColor = .appBackground
|
||||
avatarContainerView.layer.masksToBounds = true
|
||||
avatarContainerView.layer.cornerCurve = .continuous
|
||||
avatarImageView.layer.masksToBounds = true
|
||||
avatarImageView.layer.cornerCurve = .continuous
|
||||
avatarImageView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(avatarPressed)))
|
||||
avatarImageView.isUserInteractionEnabled = true
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ class ConversationMainStatusCollectionViewCell: UICollectionViewListCell, Status
|
|||
private static let avatarImageViewSize: CGFloat = 50
|
||||
private(set) lazy var avatarImageView = CachedImageView(cache: .avatars).configure {
|
||||
$0.layer.masksToBounds = true
|
||||
$0.layer.cornerCurve = .continuous
|
||||
NSLayoutConstraint.activate([
|
||||
$0.heightAnchor.constraint(equalToConstant: ConversationMainStatusCollectionViewCell.avatarImageViewSize),
|
||||
$0.widthAnchor.constraint(equalToConstant: ConversationMainStatusCollectionViewCell.avatarImageViewSize),
|
||||
|
|
|
@ -102,7 +102,6 @@ class StatusCardView: UIView {
|
|||
hStack.spacing = 4
|
||||
hStack.clipsToBounds = true
|
||||
hStack.layer.borderWidth = 0.5
|
||||
hStack.layer.cornerCurve = .continuous
|
||||
hStack.backgroundColor = inactiveBackgroundColor
|
||||
updateBorderColor()
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@ class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollecti
|
|||
$0.image = reblogIcon
|
||||
$0.contentMode = .scaleAspectFit
|
||||
$0.layer.masksToBounds = true
|
||||
$0.layer.cornerCurve = .continuous
|
||||
$0.tintColor = .secondaryLabel
|
||||
NSLayoutConstraint.activate([
|
||||
// this needs to be lessThanOrEqualTo not just equalTo b/c otherwise intermediate layouts are broken
|
||||
|
@ -76,7 +75,6 @@ class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollecti
|
|||
private static let avatarImageViewSize: CGFloat = 50
|
||||
private(set) lazy var avatarImageView = CachedImageView(cache: .avatars).configure {
|
||||
$0.layer.masksToBounds = true
|
||||
$0.layer.cornerCurve = .continuous
|
||||
NSLayoutConstraint.activate([
|
||||
$0.heightAnchor.constraint(equalToConstant: TimelineStatusCollectionViewCell.avatarImageViewSize),
|
||||
$0.widthAnchor.constraint(equalToConstant: TimelineStatusCollectionViewCell.avatarImageViewSize),
|
||||
|
|
Loading…
Reference in New Issue