Add search and mark all as read toolbar items
This commit is contained in:
parent
fe671f079d
commit
38dd0257bb
|
@ -10,11 +10,6 @@ import AppKit
|
|||
import RSCore
|
||||
import Account
|
||||
|
||||
extension NSImage.Name {
|
||||
static let star = NSImage.Name("star")
|
||||
static let timelineStar = NSImage.Name("timelineStar")
|
||||
}
|
||||
|
||||
struct AppAssets {
|
||||
|
||||
static var accountCloudKit: RSImage! = {
|
||||
|
@ -132,6 +127,10 @@ struct AppAssets {
|
|||
}
|
||||
}()
|
||||
|
||||
static var markAllAsReadImage: RSImage = {
|
||||
return RSImage(named: "markAllAsRead")!
|
||||
}()
|
||||
|
||||
@available(macOS 10.16, *)
|
||||
static var readClosedImage: RSImage = {
|
||||
return NSImage(systemSymbolName: "largecircle.fill.circle", accessibilityDescription: nil)!
|
||||
|
@ -177,7 +176,7 @@ struct AppAssets {
|
|||
let coloredImage = image.tinted(with: NSColor(named: "StarColor")!)
|
||||
return coloredImage
|
||||
} else {
|
||||
return RSImage(named: .timelineStar)
|
||||
return RSImage(named: "timelineStar")
|
||||
}
|
||||
}()
|
||||
|
||||
|
|
|
@ -731,6 +731,17 @@ extension MainWindowController: NSToolbarDelegate {
|
|||
toolbarItem.menu = buildNewSidebarItemMenu()
|
||||
return toolbarItem
|
||||
|
||||
case .search:
|
||||
let toolbarItem = NSSearchToolbarItem(itemIdentifier: .search)
|
||||
let description = NSLocalizedString("Search", comment: "Search")
|
||||
toolbarItem.toolTip = description
|
||||
toolbarItem.label = description
|
||||
return toolbarItem
|
||||
|
||||
case .markAllAsRead:
|
||||
let title = NSLocalizedString("Mark All as Read", comment: "Mark All as Read")
|
||||
return toolbarButton(.markAllAsRead, title, AppAssets.markAllAsReadImage, "markAllAsRead:")
|
||||
|
||||
case .timelineTrackingSeparator:
|
||||
return NSTrackingSeparatorToolbarItem(identifier: .timelineTrackingSeparator, splitView: splitViewController!.splitView, dividerIndex: 1)
|
||||
|
||||
|
@ -749,8 +760,8 @@ extension MainWindowController: NSToolbarDelegate {
|
|||
.refresh,
|
||||
.newSidebarItemMenu,
|
||||
.sidebarTrackingSeparator,
|
||||
// .search,
|
||||
// .markAllAsRead,
|
||||
.search,
|
||||
.markAllAsRead,
|
||||
.timelineTrackingSeparator,
|
||||
.flexibleSpace,
|
||||
// .nextUnread,
|
||||
|
@ -786,8 +797,8 @@ extension MainWindowController: NSToolbarDelegate {
|
|||
.refresh,
|
||||
.newSidebarItemMenu,
|
||||
.sidebarTrackingSeparator,
|
||||
// .search,
|
||||
// .markAllAsRead,
|
||||
.search,
|
||||
.markAllAsRead,
|
||||
.timelineTrackingSeparator,
|
||||
.flexibleSpace,
|
||||
// .nextUnread,
|
||||
|
|
Loading…
Reference in New Issue