slim the button width again

This commit is contained in:
Ryan Zhao 2022-03-03 13:35:27 +11:00
parent ea64469c2b
commit c08b1617c2
4 changed files with 5 additions and 5 deletions

View File

@ -70,7 +70,7 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, NewConv
let createNewPrivateChatButton = Button(style: .prominentOutline, size: .large)
createNewPrivateChatButton.setTitle(NSLocalizedString("vc_home_empty_state_button_title", comment: ""), for: UIControl.State.normal)
createNewPrivateChatButton.addTarget(self, action: #selector(createNewDM), for: UIControl.Event.touchUpInside)
createNewPrivateChatButton.set(.width, to: 196)
createNewPrivateChatButton.set(.width, to: Values.iPadButtonWidth)
let result = UIStackView(arrangedSubviews: [ explanationLabel, createNewPrivateChatButton ])
result.axis = .vertical
result.spacing = Values.mediumSpacing

View File

@ -159,8 +159,7 @@ class MessageRequestsViewController: BaseVC, UITableViewDelegate, UITableViewDat
equalTo: view.safeAreaLayoutGuide.bottomAnchor,
constant: -Values.largeSpacing
),
// Note: The '182' is to match the 'Next' button on the New DM page (which doesn't have a fixed width)
clearAllButton.widthAnchor.constraint(equalToConstant: 182),
clearAllButton.widthAnchor.constraint(equalToConstant: Values.iPadButtonWidth),
clearAllButton.heightAnchor.constraint(equalToConstant: NewConversationButtonSet.collapsedButtonSize)
])
}

View File

@ -53,7 +53,7 @@ class Modal: BaseVC, UIGestureRecognizerDelegate {
private func setUpViewHierarchy() {
view.addSubview(contentView)
if UIDevice.current.isIPad {
contentView.set(.width, to: Values.iPadButtonWidth)
contentView.set(.width, to: Values.iPadModalWidth)
contentView.center(in: view)
} else {
contentView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: Values.veryLargeSpacing).isActive = true

View File

@ -44,6 +44,7 @@ public final class Values : NSObject {
@objc public static let onboardingButtonBottomOffset = isIPhone5OrSmaller ? CGFloat(52) : CGFloat(72)
// MARK: - iPad Sizes
@objc public static let iPadButtonWidth = UIScreen.main.bounds.width / 2
@objc public static let iPadModalWidth = UIScreen.main.bounds.width / 2
@objc public static let iPadButtonWidth = CGFloat(196)
@objc public static let iPadButtonSpacing = CGFloat(32)
}