Some multiple tab fixes

This commit is contained in:
James Magahern
2020-07-31 14:39:18 -07:00
parent 4227e2ecaa
commit 9272c34d3d
5 changed files with 50 additions and 25 deletions

View File

@@ -63,20 +63,28 @@ class TabPickerViewController: UIViewController, UICollectionViewDelegate
var config = listCell.defaultContentConfiguration()
if let tab = self.tabController.tab(forIdentifier: item) {
if let title = tab.title {
if let title = tab.title, title.count > 0 {
config.text = title
config.secondaryText = tab.url?.absoluteString
} else if let url = tab.url {
config.text = url.absoluteString
config.secondaryText = url.absoluteString
} else {
config.text = tab.url?.absoluteString
config.secondaryText = tab.url?.absoluteString
config.text = "New Tab"
}
config.textProperties.numberOfLines = 1
config.secondaryTextProperties.numberOfLines = 1
if let image = tab.favicon {
config.image = image
config.imageProperties.maximumSize = CGSize(width: 21.0, height: 21.0)
config.imageProperties.cornerRadius = 3.0
} else {
config.image = UIImage(systemName: "safari")
}
config.imageProperties.maximumSize = CGSize(width: 21.0, height: 21.0)
config.imageProperties.cornerRadius = 3.0
if tab == self.selectedTab {
listCell.accessories = [ .checkmark() ]
} else {