Browse Source

slim the button width again

pull/565/head
Ryan Zhao 11 months ago
parent
commit
c08b1617c2
  1. 2
      Session/Home/HomeVC.swift
  2. 3
      Session/Home/Message Requests/MessageRequestsViewController.swift
  3. 2
      Session/Sheets & Modals/Modal.swift
  4. 3
      SessionUIKit/Style Guide/Values.swift

2
Session/Home/HomeVC.swift

@ -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

3
Session/Home/Message Requests/MessageRequestsViewController.swift

@ -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)
])
}

2
Session/Sheets & Modals/Modal.swift

@ -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

3
SessionUIKit/Style Guide/Values.swift

@ -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)
}

Loading…
Cancel
Save