Skip to content

Commit 41d1e1f

Browse files
committed
8355 Consistent button size on orientation change
Previously, if you had the phone in landscape when the “Payment Successful” modal was shown, the two primary buttons would be displayed side by side at different sizes. Changing to portrait and back to landscape resulted in two different sizes showing, which felt strange. Using the `fillProportionally` option resolves this and leads to a more consistent view in this edge case.
1 parent 6c439ee commit 41d1e1f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@ final class CardPresentPaymentsModalViewController: UIViewController, CardReader
7171
private func resetHeightAndWidth() {
7272
if traitCollection.containsTraits(in: UITraitCollection(verticalSizeClass: .compact)) {
7373
primaryActionButtonsStackView.axis = .horizontal
74+
primaryActionButtonsStackView.distribution = .fillProportionally
7475

7576
mainStackView.distribution = .fillProportionally
7677
heightConstraint.constant = Constants.modalWidth
7778
widthConstraint.constant = Constants.modalHeight
7879
} else {
7980
primaryActionButtonsStackView.axis = .vertical
81+
primaryActionButtonsStackView.distribution = .fill
8082

8183
mainStackView.distribution = .fill
8284
heightConstraint.constant = Constants.modalHeight

0 commit comments

Comments
 (0)