Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Classes/Bookmark/BookmarkNavigationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ final class BookmarkNavigationController {

private let store: BookmarkStore
private let model: Bookmark
private static let iconImageInset = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 0)

init?(store: BookmarkStore?, model: Bookmark?) {
guard let store = store, let model = model else { return nil }
Expand Down Expand Up @@ -51,13 +52,15 @@ final class BookmarkNavigationController {
item.action = selector
item.isEnabled = true
item.width = 0
item.imageInsets = BookmarkNavigationController.iconImageInset
}

//for timeframe between viewDidLoad() and bookmark info is loaded
static var disabledNavigationItem: UIBarButtonItem {
let item = UIBarButtonItem()
item.image = UIImage(named: "nav-bookmark")?.withRenderingMode(.alwaysTemplate)
item.isEnabled = false
item.imageInsets = BookmarkNavigationController.iconImageInset
return item
}

Expand Down
6 changes: 1 addition & 5 deletions Classes/Issues/IssuesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ final class IssuesViewController:
bottom: 2 * Styles.Sizes.rowSpacing + Styles.Sizes.tableCellHeight,
right: Styles.Sizes.gutter
)
private let bookmarkIconInset = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 0)

private var needsScrollToBottom = false
private var lastTimelineElement: ListDiffable?
Expand Down Expand Up @@ -199,9 +198,7 @@ final class IssuesViewController:
messageView.add(contentView: actions)

//show disabled bookmark button until issue has finished loading
let disabledNavItem = BookmarkNavigationController.disabledNavigationItem
disabledNavItem.imageInsets = bookmarkIconInset
navigationItem.rightBarButtonItems = [ moreOptionsItem, disabledNavItem ]
navigationItem.rightBarButtonItems = [ moreOptionsItem, BookmarkNavigationController.disabledNavigationItem ]

// insert below so button doesn't appear above autocomplete
view.insertSubview(manageController.manageButton, belowSubview: messageView)
Expand Down Expand Up @@ -264,7 +261,6 @@ final class IssuesViewController:
guard let rightbarButtonItems = navigationItem.rightBarButtonItems else { return }
guard let bookmarkItem = rightbarButtonItems.last else { return }
bookmarkNavController?.configureNavigationItem(bookmarkItem)
bookmarkItem.imageInsets = bookmarkIconInset
}

func viewRepoAction() -> UIAlertAction? {
Expand Down
2 changes: 1 addition & 1 deletion Classes/Utility/AlertAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct AlertAction {
case .shareContent: return NSLocalizedString("Share Content", comment: "")
case .shareFilePath: return NSLocalizedString("Copy Path", comment: "")
case .shareFileName: return NSLocalizedString("Copy Name", comment: "")
default: return NSLocalizedString("Share", comment: "")
case .default: return NSLocalizedString("Share", comment: "")
}
}
}
Expand Down