diff --git a/Mac/AppAssets.swift b/Mac/AppAssets.swift index 2762a3a57..c713dff5d 100644 --- a/Mac/AppAssets.swift +++ b/Mac/AppAssets.swift @@ -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") } }() diff --git a/Mac/MainWindow/MainWindowController.swift b/Mac/MainWindow/MainWindowController.swift index b8e36387f..c1b28cc84 100644 --- a/Mac/MainWindow/MainWindowController.swift +++ b/Mac/MainWindow/MainWindowController.swift @@ -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,