Fix title for login-screen (#690)

Was a norma label, is the _real_ title now
This commit is contained in:
Nathan Mattes 2023-01-08 14:53:15 +01:00
parent 023e70ebcb
commit 485ecc8e57
2 changed files with 16 additions and 25 deletions

View File

@ -13,9 +13,7 @@ class MastodonLoginView: UIView {
// List with (filtered) domains
let titleLabel: UILabel
let subtitleLabel: UILabel
private let headerStackView: UIStackView
let explanationTextLabel: UILabel
let searchTextField: UITextField
private let searchTextFieldLeftView: UIView
@ -28,22 +26,12 @@ class MastodonLoginView: UIView {
override init(frame: CGRect) {
titleLabel = UILabel()
titleLabel.font = MastodonLoginViewController.largeTitleFont
titleLabel.textColor = MastodonLoginViewController.largeTitleTextColor
titleLabel.text = L10n.Scene.Login.title
titleLabel.numberOfLines = 0
subtitleLabel = UILabel()
subtitleLabel.font = MastodonLoginViewController.subTitleFont
subtitleLabel.textColor = MastodonLoginViewController.subTitleTextColor
subtitleLabel.text = L10n.Scene.Login.subtitle
subtitleLabel.numberOfLines = 0
headerStackView = UIStackView(arrangedSubviews: [titleLabel, subtitleLabel])
headerStackView.axis = .vertical
headerStackView.spacing = 16
headerStackView.translatesAutoresizingMaskIntoConstraints = false
explanationTextLabel = UILabel()
explanationTextLabel.translatesAutoresizingMaskIntoConstraints = false
explanationTextLabel.font = MastodonLoginViewController.subTitleFont
explanationTextLabel.textColor = MastodonLoginViewController.subTitleTextColor
explanationTextLabel.text = L10n.Scene.Login.subtitle
explanationTextLabel.numberOfLines = 0
searchTextFieldMagnifyingGlass = UIImageView(image: UIImage(
systemName: "magnifyingglass",
@ -81,7 +69,7 @@ class MastodonLoginView: UIView {
super.init(frame: frame)
addSubview(headerStackView)
addSubview(explanationTextLabel)
addSubview(searchTextField)
addSubview(tableView)
addSubview(navigationActionView)
@ -99,12 +87,11 @@ class MastodonLoginView: UIView {
let bottomConstraint = safeAreaLayoutGuide.bottomAnchor.constraint(equalTo: navigationActionView.bottomAnchor)
let constraints = [
explanationTextLabel.topAnchor.constraint(equalTo: safeAreaLayoutGuide.topAnchor),
explanationTextLabel.leadingAnchor.constraint(equalTo: readableContentGuide.leadingAnchor),
explanationTextLabel.trailingAnchor.constraint(equalTo: readableContentGuide.trailingAnchor),
headerStackView.topAnchor.constraint(equalTo: safeAreaLayoutGuide.topAnchor),
headerStackView.leadingAnchor.constraint(equalTo: readableContentGuide.leadingAnchor),
headerStackView.trailingAnchor.constraint(equalTo: readableContentGuide.trailingAnchor),
searchTextField.topAnchor.constraint(equalTo: headerStackView.bottomAnchor, constant: 32),
searchTextField.topAnchor.constraint(equalTo: explanationTextLabel.bottomAnchor, constant: 32),
searchTextField.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 16),
searchTextField.heightAnchor.constraint(equalToConstant: 55),
trailingAnchor.constraint(equalTo: searchTextField.trailingAnchor, constant: 16),

View File

@ -11,6 +11,7 @@ import MastodonCore
import MastodonAsset
import Combine
import AuthenticationServices
import MastodonLocalization
protocol MastodonLoginViewControllerDelegate: AnyObject {
func backButtonPressed(_ viewController: MastodonLoginViewController)
@ -97,6 +98,9 @@ class MastodonLoginViewController: UIViewController, NeedsDependency {
defer { setupNavigationBarBackgroundView() }
setupOnboardingAppearance()
title = L10n.Scene.Login.title
navigationItem.hidesBackButton = true
}
override func viewWillAppear(_ animated: Bool) {