Compare commits
No commits in common. "71831e58f21d48bbfb540725542d6ea3dd53d2a3" and "92fe14cd9bc9bbfb3d87942401735998b5b41f8b" have entirely different histories.
71831e58f2
...
92fe14cd9b
|
@ -34,10 +34,6 @@ class BrowserNavigationController: UIViewController {
|
||||||
|
|
||||||
if (oldValue <= 0.5 && toolbarOffset > 0.5) || (oldValue > 0.5 && toolbarOffset <= 0.5) {
|
if (oldValue <= 0.5 && toolbarOffset > 0.5) || (oldValue > 0.5 && toolbarOffset <= 0.5) {
|
||||||
setNeedsStatusBarAppearanceUpdate()
|
setNeedsStatusBarAppearanceUpdate()
|
||||||
|
|
||||||
if navBarView.textField.isFirstResponder {
|
|
||||||
navBarView.textField.resignFirstResponder()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -209,10 +205,6 @@ class BrowserNavigationController: UIViewController {
|
||||||
if position == .end {
|
if position == .end {
|
||||||
self.navigator.goBack()
|
self.navigator.goBack()
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.navBarView.textField.isFirstResponder {
|
|
||||||
self.navBarView.textField.resignFirstResponder()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
gestureState = .backwards(animator)
|
gestureState = .backwards(animator)
|
||||||
} else if location.x > view.bounds.width - startEdgeNavigationSwipeDistance && velocity.x < 0 && navigator.forwardStack.count > 0 {
|
} else if location.x > view.bounds.width - startEdgeNavigationSwipeDistance && velocity.x < 0 && navigator.forwardStack.count > 0 {
|
||||||
|
@ -244,10 +236,6 @@ class BrowserNavigationController: UIViewController {
|
||||||
if position == .end {
|
if position == .end {
|
||||||
self.navigator.goForward()
|
self.navigator.goForward()
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.navBarView.textField.isFirstResponder {
|
|
||||||
self.navBarView.textField.resignFirstResponder()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
gestureState = .forwards(animator)
|
gestureState = .forwards(animator)
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,6 @@ class BrowserWebViewController: UIViewController {
|
||||||
webView.scrollView.delegate = scrollViewDelegate
|
webView.scrollView.delegate = scrollViewDelegate
|
||||||
// this doesn't default to .default :S
|
// this doesn't default to .default :S
|
||||||
webView.scrollView.indicatorStyle = .default
|
webView.scrollView.indicatorStyle = .default
|
||||||
webView.scrollView.keyboardDismissMode = .interactive
|
|
||||||
webView.translatesAutoresizingMaskIntoConstraints = false
|
webView.translatesAutoresizingMaskIntoConstraints = false
|
||||||
view.addSubview(webView)
|
view.addSubview(webView)
|
||||||
NSLayoutConstraint.activate([
|
NSLayoutConstraint.activate([
|
||||||
|
|
|
@ -14,7 +14,7 @@ class NavigationBarView: UIView {
|
||||||
let navigator: NavigationManager
|
let navigator: NavigationManager
|
||||||
|
|
||||||
private var border: UIView!
|
private var border: UIView!
|
||||||
private(set) var textField: UITextField!
|
private var textField: UITextField!
|
||||||
|
|
||||||
private var cancellables = [AnyCancellable]()
|
private var cancellables = [AnyCancellable]()
|
||||||
|
|
||||||
|
@ -40,10 +40,9 @@ class NavigationBarView: UIView {
|
||||||
textField.text = navigator.displayURL
|
textField.text = navigator.displayURL
|
||||||
textField.borderStyle = .roundedRect
|
textField.borderStyle = .roundedRect
|
||||||
textField.keyboardType = .URL
|
textField.keyboardType = .URL
|
||||||
textField.returnKeyType = .go
|
|
||||||
textField.autocapitalizationType = .none
|
textField.autocapitalizationType = .none
|
||||||
textField.autocorrectionType = .no
|
textField.autocorrectionType = .no
|
||||||
textField.addTarget(self, action: #selector(commitURL), for: .primaryActionTriggered)
|
textField.addTarget(self, action: #selector(commitURL), for: .editingDidEnd)
|
||||||
textField.translatesAutoresizingMaskIntoConstraints = false
|
textField.translatesAutoresizingMaskIntoConstraints = false
|
||||||
addSubview(textField)
|
addSubview(textField)
|
||||||
NSLayoutConstraint.activate([
|
NSLayoutConstraint.activate([
|
||||||
|
@ -76,12 +75,8 @@ class NavigationBarView: UIView {
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc private func commitURL() {
|
@objc private func commitURL() {
|
||||||
textField.resignFirstResponder()
|
if let text = textField.text, let url = URL(string: text) {
|
||||||
if let text = textField.text, var components = URLComponents(string: text) {
|
navigator.changeURL(url)
|
||||||
if components.scheme == nil {
|
|
||||||
components.scheme = "gemini"
|
|
||||||
}
|
|
||||||
navigator.changeURL(components.url!)
|
|
||||||
} else {
|
} else {
|
||||||
textField.text = navigator.displayURL
|
textField.text = navigator.displayURL
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue