Skip to content

Commit

Permalink
- BookmarkSetupViewController
Browse files Browse the repository at this point in the history
	- limit logo height to better fit screen height
	- no longer show logo when adding additional accounts to make up for the lost space due to the UINavigationBar being included, to work across all screen heights
  • Loading branch information
felix-schwarz committed Oct 20, 2023
1 parent c58b112 commit 7a5ae33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions ownCloud/Bookmarks/BookmarkViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,7 @@ extension BookmarkViewController {
setupViewController.navigationItem.titleLabelText = "Add account".localized

let navigationViewController = ThemeNavigationController(rootViewController: setupViewController)
navigationViewController.modalPresentationStyle = .fullScreen
hostViewController.present(navigationViewController, animated: true, completion: nil)
}
}
Expand Down
9 changes: 6 additions & 3 deletions ownCloud/Bookmarks/Setup/BookmarkSetupViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class BookmarkSetupViewController: EmbeddingViewController, BookmarkComposerDele

override func loadView() {
let contentView = UIView()
contentView.translatesAutoresizingMaskIntoConstraints = false

visibleContentContainerView.translatesAutoresizingMaskIntoConstraints = false

Expand All @@ -66,8 +65,12 @@ class BookmarkSetupViewController: EmbeddingViewController, BookmarkComposerDele
self.cssSelectors = [.modal, .accountSetup]

// Add logo
let maxLogoSize = CGSize(width: 256, height: 128)
logoView = BrandView(showBackground: false, showLogo: true, logoMaxSize: maxLogoSize, fitToLogo: true, roundedCorners: false, assetSuffix: .setup)
if navigationController == nil {
let deviceScreenHeight = UIScreen.main.bounds.height
let logoMaxHeight = deviceScreenHeight < 800 ? (deviceScreenHeight < 600 ? 48 : 96) : 128
let maxLogoSize = CGSize(width: 256, height: logoMaxHeight)
logoView = BrandView(showBackground: false, showLogo: true, logoMaxSize: maxLogoSize, fitToLogo: true, roundedCorners: false, assetSuffix: .setup)
}

if let logoView {
contentView.addSubview(logoView)
Expand Down

0 comments on commit 7a5ae33

Please sign in to comment.