Some appearance tweaks
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
class URLBar: UIView
|
||||
class URLBar: ReliefButton
|
||||
{
|
||||
let textField = UITextField(frame: .zero)
|
||||
let refreshButton = UIButton(frame: .zero)
|
||||
@@ -23,8 +23,6 @@ class URLBar: UIView
|
||||
didSet { updateProgressIndicator() }
|
||||
}
|
||||
|
||||
private let backgroundView = UIVisualEffectView(effect: UIBlurEffect(style: .systemThickMaterial))
|
||||
private let shadowView = UIView(frame: .zero)
|
||||
private let fadeMaskView = UIImageView(frame: .zero)
|
||||
|
||||
private let progressIndicatorView = ProgressIndicatorView()
|
||||
@@ -33,21 +31,14 @@ class URLBar: UIView
|
||||
private let refreshImage = UIImage(systemName: "arrow.clockwise")
|
||||
private let stopImage = UIImage(systemName: "xmark")
|
||||
|
||||
private let backgroundCornerRadius: CGFloat = 4
|
||||
private let backgroundCornerRadius: CGFloat = 0
|
||||
|
||||
convenience init() {
|
||||
self.init(frame: .zero)
|
||||
override init() {
|
||||
super.init()
|
||||
|
||||
backgroundColor = .clear
|
||||
|
||||
backgroundView.layer.masksToBounds = true
|
||||
backgroundView.layer.cornerRadius = backgroundCornerRadius
|
||||
backgroundView.layer.borderWidth = 1
|
||||
backgroundView.layer.borderColor = UIColor.secondarySystemFill.cgColor
|
||||
backgroundView.isUserInteractionEnabled = false
|
||||
addSubview(backgroundView)
|
||||
|
||||
backgroundView.contentView.addSubview(progressIndicatorView)
|
||||
backgroundView.addSubview(progressIndicatorView)
|
||||
|
||||
textField.backgroundColor = .clear
|
||||
textField.textContentType = .URL
|
||||
@@ -82,6 +73,10 @@ class URLBar: UIView
|
||||
setErrorButtonAnimating(false)
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
private func updateProgressIndicator() {
|
||||
setErrorButtonAnimating(false)
|
||||
|
||||
@@ -176,7 +171,7 @@ class URLBar: UIView
|
||||
super.layoutSubviews()
|
||||
backgroundView.frame = bounds
|
||||
shadowView.frame = bounds
|
||||
progressIndicatorView.frame = backgroundView.contentView.bounds
|
||||
progressIndicatorView.frame = backgroundView.bounds
|
||||
textField.frame = bounds.insetBy(dx: 6.0, dy: 0)
|
||||
|
||||
var fadeCutoffLocation: CGFloat = 0.8
|
||||
|
||||
Reference in New Issue
Block a user