mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-01 01:40:22 +00:00
Space out the toolbar items on iOS 17/18. Give the article extractor button a stable width, so it doesn’t change widths when the progress indicator is showing.
This commit is contained in:
1 parent
1b59651e8a
commit
c12970dfc4
2 files changed
+19
-1
No files matched your search
@@ -80,6 +80,7 @@ final class ArticleExtractorButton: UIButton {
|
||||
private func commonInit() {
|
||||
addSubview(activityIndicator)
|
||||
NSLayoutConstraint.activate([
|
||||
widthAnchor.constraint(equalToConstant: 44.0),
|
||||
activityIndicator.centerXAnchor.constraint(equalTo: centerXAnchor),
|
||||
activityIndicator.centerYAnchor.constraint(equalTo: centerYAnchor)
|
||||
])
|
||||
|
||||
@@ -117,7 +117,24 @@ final class ArticleViewController: UIViewController {
|
||||
navigationItem.titleView = fullScreenTapZone
|
||||
|
||||
articleExtractorButton.addTarget(self, action: #selector(toggleArticleExtractor(_:)), for: .touchUpInside)
|
||||
toolbarItems?.insert(UIBarButtonItem(customView: articleExtractorButton), at: 5)
|
||||
let articleExtractorBarButtonItem = UIBarButtonItem(customView: articleExtractorButton)
|
||||
|
||||
if #available(iOS 26, *) {
|
||||
toolbarItems?.insert(articleExtractorBarButtonItem, at: 5)
|
||||
} else {
|
||||
let flex = { UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil) }
|
||||
toolbarItems = [
|
||||
readBarButtonItem,
|
||||
flex(),
|
||||
starBarButtonItem,
|
||||
flex(),
|
||||
nextUnreadBarButtonItem,
|
||||
flex(),
|
||||
articleExtractorBarButtonItem,
|
||||
flex(),
|
||||
actionBarButtonItem
|
||||
]
|
||||
}
|
||||
|
||||
pageViewController = UIPageViewController(transitionStyle: .scroll, navigationOrientation: .horizontal, options: [:])
|
||||
pageViewController.delegate = self
|
||||
|
||||
Reference in new issue
Block a user