Autocomplete: tweaks to view hierarchy

This commit is contained in:
James Magahern
2020-09-21 18:09:00 -07:00
parent 3086ed7eae
commit 14a28a0776
3 changed files with 31 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ class BrowserView: UIView
didSet { addSubview(toolbarView!) }
}
var autocompleteView: UICollectionView? {
var autocompleteView: UIView? {
didSet {
addSubview(autocompleteView!)
if let toolbarView = toolbarView {
@@ -118,13 +118,15 @@ class BrowserView: UIView
if let autocompleteView = autocompleteView {
// Compact: autocomplete view takes the space of the webview
autocompleteView.frame = bounds.inset(by: webViewContentInset)
if traitCollection.horizontalSizeClass == .regular {
// Regular: shows up just underneath the url bar
autocompleteView.layer.shadowColor = UIColor.black.cgColor
autocompleteView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
autocompleteView.layer.shadowRadius = 3.0
autocompleteView.layer.shadowOpacity = 0.8
autocompleteView.layer.shadowRadius = 8.0
autocompleteView.layer.shadowOpacity = 0.6
autocompleteView.layer.cornerRadius = 8.0
autocompleteView.layer.masksToBounds = true
if let toolbarView = toolbarView, let urlBar = toolbarView.urlBar {
let urlFrame = self.convert(urlBar.frame, from: urlBar.superview)