Long press on the window button to open a new tab
This commit is contained in:
@@ -155,6 +155,7 @@ class ToolbarViewController: UIViewController
|
||||
let windowButton = UIButton(frame: .zero)
|
||||
let backButton = UIButton(frame: .zero)
|
||||
let forwardButton = UIButton(frame: .zero)
|
||||
let newTabButton = UIButton(frame: .zero)
|
||||
|
||||
var darkModeEnabled: Bool = false {
|
||||
didSet {
|
||||
@@ -189,6 +190,9 @@ class ToolbarViewController: UIViewController
|
||||
// Forward button
|
||||
forwardButton.setImage(UIImage(systemName: "chevron.right"), for: .normal)
|
||||
|
||||
// New tab button
|
||||
newTabButton.setImage(UIImage(systemName: "plus"), for: .normal)
|
||||
|
||||
let toolbarAnimationDuration: TimeInterval = 0.3
|
||||
urlBar.textField.addAction(.init(handler: { [traitCollection, toolbarView, urlBar] _ in
|
||||
if traitCollection.horizontalSizeClass == .compact {
|
||||
@@ -223,6 +227,7 @@ class ToolbarViewController: UIViewController
|
||||
toolbarView.trailingButtonsView.addButtonView(darkModeButton)
|
||||
toolbarView.trailingButtonsView.addButtonView(shareButton)
|
||||
toolbarView.trailingButtonsView.addButtonView(scriptControllerIconView)
|
||||
toolbarView.trailingButtonsView.addButtonView(newTabButton)
|
||||
toolbarView.trailingButtonsView.addButtonView(windowButton)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user