diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2021-07-13 11:54:55 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2021-07-19 10:49:00 +0200 |
| commit | 2fa713409a2d240b470bac61689ba171f57a3831 (patch) | |
| tree | faa0acb4aca2e1cd46153af9b5f17ac36d99e743 | |
| parent | fda131d31789bc0a4447ce9c6b99f5868228cf3d (diff) | |
| download | mullvadvpn-2fa713409a2d240b470bac61689ba171f57a3831.tar.xz mullvadvpn-2fa713409a2d240b470bac61689ba171f57a3831.zip | |
UIMetrics: add section spacing metric
| -rw-r--r-- | ios/MullvadVPN/PreferencesViewController.swift | 2 | ||||
| -rw-r--r-- | ios/MullvadVPN/SelectLocationHeaderView.swift | 2 | ||||
| -rw-r--r-- | ios/MullvadVPN/SettingsViewController.swift | 2 | ||||
| -rw-r--r-- | ios/MullvadVPN/UIMetrics.swift | 3 | ||||
| -rw-r--r-- | ios/MullvadVPN/WireguardKeysContentView.swift | 4 |
5 files changed, 8 insertions, 5 deletions
diff --git a/ios/MullvadVPN/PreferencesViewController.swift b/ios/MullvadVPN/PreferencesViewController.swift index f895923bb3..756f44f4cc 100644 --- a/ios/MullvadVPN/PreferencesViewController.swift +++ b/ios/MullvadVPN/PreferencesViewController.swift @@ -35,7 +35,7 @@ class PreferencesViewController: UITableViewController, TunnelObserver { tableView.separatorColor = .secondaryColor tableView.rowHeight = UITableView.automaticDimension tableView.estimatedRowHeight = 60 - tableView.sectionHeaderHeight = UIMetrics.contentLayoutMargins.top + tableView.sectionHeaderHeight = UIMetrics.sectionSpacing tableView.sectionFooterHeight = 0 tableView.dataSource = staticDataSource diff --git a/ios/MullvadVPN/SelectLocationHeaderView.swift b/ios/MullvadVPN/SelectLocationHeaderView.swift index c0593418d2..60a1cd75cf 100644 --- a/ios/MullvadVPN/SelectLocationHeaderView.swift +++ b/ios/MullvadVPN/SelectLocationHeaderView.swift @@ -22,7 +22,7 @@ class SelectLocationHeaderView: UIView { var topLayoutMarginAdjustmentForNavigationBarTitle: CGFloat = 0 { didSet { - let value = UIMetrics.contentLayoutMargins.top - topLayoutMarginAdjustmentForNavigationBarTitle + let value = UIMetrics.sectionSpacing - topLayoutMarginAdjustmentForNavigationBarTitle layoutMargins.top = max(value, 0) } } diff --git a/ios/MullvadVPN/SettingsViewController.swift b/ios/MullvadVPN/SettingsViewController.swift index 0735c60542..a1a32f842f 100644 --- a/ios/MullvadVPN/SettingsViewController.swift +++ b/ios/MullvadVPN/SettingsViewController.swift @@ -46,7 +46,7 @@ class SettingsViewController: UITableViewController, AccountObserver { tableView.separatorColor = .secondaryColor tableView.rowHeight = UITableView.automaticDimension tableView.estimatedRowHeight = 60 - tableView.sectionHeaderHeight = UIMetrics.contentLayoutMargins.top + tableView.sectionHeaderHeight = UIMetrics.sectionSpacing tableView.sectionFooterHeight = 0 tableView.dataSource = staticDataSource diff --git a/ios/MullvadVPN/UIMetrics.swift b/ios/MullvadVPN/UIMetrics.swift index c30b44e291..9f60a35278 100644 --- a/ios/MullvadVPN/UIMetrics.swift +++ b/ios/MullvadVPN/UIMetrics.swift @@ -21,6 +21,9 @@ extension UIMetrics { /// Spacing used in stack views of buttons static var interButtonSpacing: CGFloat = 16 + /// Spacing used between distinct sections of views + static var sectionSpacing: CGFloat = 24 + /// Maximum width of the split view content container on iPad static var maximumSplitViewContentContainerWidth: CGFloat = 810 * 0.7 diff --git a/ios/MullvadVPN/WireguardKeysContentView.swift b/ios/MullvadVPN/WireguardKeysContentView.swift index 2db0ebf4ca..cefc662cb6 100644 --- a/ios/MullvadVPN/WireguardKeysContentView.swift +++ b/ios/MullvadVPN/WireguardKeysContentView.swift @@ -54,7 +54,7 @@ class WireguardKeysContentView: UIView { let stackView = UIStackView(arrangedSubviews: [publicKeyRowView, creationRowView]) stackView.translatesAutoresizingMaskIntoConstraints = false stackView.axis = .vertical - stackView.spacing = UIMetrics.contentLayoutMargins.top + stackView.spacing = UIMetrics.sectionSpacing return stackView }() @@ -79,7 +79,7 @@ class WireguardKeysContentView: UIView { contentStackView.leadingAnchor.constraint(equalTo: layoutMarginsGuide.leadingAnchor), contentStackView.trailingAnchor.constraint(equalTo: layoutMarginsGuide.trailingAnchor), - buttonStackView.topAnchor.constraint(greaterThanOrEqualTo: contentStackView.bottomAnchor, constant: UIMetrics.contentLayoutMargins.top), + buttonStackView.topAnchor.constraint(greaterThanOrEqualTo: contentStackView.bottomAnchor, constant: UIMetrics.sectionSpacing), buttonStackView.leadingAnchor.constraint(equalTo: layoutMarginsGuide.leadingAnchor), buttonStackView.trailingAnchor.constraint(equalTo: layoutMarginsGuide.trailingAnchor), buttonStackView.bottomAnchor.constraint(equalTo: layoutMarginsGuide.bottomAnchor) |
