Some appearance tweaks

This commit is contained in:
James Magahern
2020-09-22 14:33:00 -07:00
parent c223c12934
commit 679e59c20b
5 changed files with 24 additions and 26 deletions

View File

@@ -14,7 +14,7 @@ class ToolbarView: UIView
var cancelButtonVisible: Bool = false { didSet { layoutSubviews() } }
let containerView = UIView(frame: .zero)
let backgroundView = UIVisualEffectView(effect: UIBlurEffect(style: .systemThickMaterial))
let backgroundView = GradientView(direction: .vertical, colors: [.tertiarySystemGroupedBackground, .secondarySystemGroupedBackground])
let cancelButton = UIButton(type: .system)
let leadingButtonsView = ToolbarButtonContainerView(frame: .zero)
@@ -95,11 +95,16 @@ class ToolbarView: UIView
}
if let urlBar = urlBar {
let origin = CGPoint(
var origin = CGPoint(
x: leadingButtonsView.frame.maxX,
y: 0.0
)
if origin.x == 0 {
// Add some padding if url bar is flush with side
origin.x = layoutMargins.left
}
urlBar.frame = CGRect(
origin: origin,
size: CGSize(
@@ -108,7 +113,7 @@ class ToolbarView: UIView
)
)
urlBar.frame = urlBar.frame.inset(by: urlBarInsets)
urlBar.frame = urlBar.frame.inset(by: urlBarInsets).inset(by: buttonContainerInset)
}
}
}