Tweak the new preference pane.

This commit is contained in:
Maurice Parker 2020-04-07 08:06:47 -05:00
parent 429ba1aed3
commit fed8fbce98
4 changed files with 22 additions and 20 deletions

View File

@ -77,6 +77,12 @@ struct AppAssets {
return RSImage(named: "articleExtractorProgress4") return RSImage(named: "articleExtractorProgress4")
}() }()
static var bookmarkImage: RSImage? = {
let path = "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns"
let image = RSImage(contentsOfFile: path)
return image
}()
static var faviconTemplateImage: RSImage = { static var faviconTemplateImage: RSImage = {
return RSImage(named: "faviconTemplateImage")! return RSImage(named: "faviconTemplateImage")!
}() }()

View File

@ -12,12 +12,12 @@ private struct PreferencesToolbarItemSpec {
let identifier: NSToolbarItem.Identifier let identifier: NSToolbarItem.Identifier
let name: String let name: String
let imageName: NSImage.Name let image: NSImage?
init(identifierRawValue: String, name: String, imageName: NSImage.Name) { init(identifierRawValue: String, name: String, image: NSImage?) {
self.identifier = NSToolbarItem.Identifier(identifierRawValue) self.identifier = NSToolbarItem.Identifier(identifierRawValue)
self.name = name self.name = name
self.imageName = imageName self.image = image
} }
} }
@ -34,16 +34,24 @@ class PreferencesWindowController : NSWindowController, NSToolbarDelegate {
private var viewControllers = [String: NSViewController]() private var viewControllers = [String: NSViewController]()
private let toolbarItemSpecs: [PreferencesToolbarItemSpec] = { private let toolbarItemSpecs: [PreferencesToolbarItemSpec] = {
var specs = [PreferencesToolbarItemSpec]() var specs = [PreferencesToolbarItemSpec]()
specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.General, name: NSLocalizedString("General", comment: "Preferences"), imageName: NSImage.preferencesGeneralName)] specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.General,
specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Accounts, name: NSLocalizedString("Accounts", comment: "Preferences"), imageName: NSImage.userAccountsName)] name: NSLocalizedString("General", comment: "Preferences"),
specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.FeedProvider, name: NSLocalizedString("Providers", comment: "Preferences"), imageName: "feedProviderToolbar")] image: NSImage(named: NSImage.preferencesGeneralName))]
specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Accounts,
name: NSLocalizedString("Accounts", comment: "Preferences"),
image: NSImage(named: NSImage.userAccountsName))]
specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.FeedProvider,
name: NSLocalizedString("Integrations", comment: "Preferences"),
image: AppAssets.bookmarkImage)]
// Omit the Advanced Preferences for now because the Software Update related functionality is // Omit the Advanced Preferences for now because the Software Update related functionality is
// forbidden/non-applicable, and we can rely upon Apple to some extent for crash reports. We // forbidden/non-applicable, and we can rely upon Apple to some extent for crash reports. We
// can add back the Crash Reporter preferences when we're ready to dynamically shuffle the rest // can add back the Crash Reporter preferences when we're ready to dynamically shuffle the rest
// of the content in this tab. // of the content in this tab.
#if !MAC_APP_STORE #if !MAC_APP_STORE
specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Advanced, name: NSLocalizedString("Advanced", comment: "Preferences"), imageName: NSImage.advancedName)] specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Advanced,
name: NSLocalizedString("Advanced", comment: "Preferences"),
image: NSImage(named: NSImage.advancedName))]
#endif #endif
return specs return specs
}() }()
@ -86,7 +94,7 @@ class PreferencesWindowController : NSWindowController, NSToolbarDelegate {
toolbarItem.target = self toolbarItem.target = self
toolbarItem.label = toolbarItemSpec.name toolbarItem.label = toolbarItemSpec.name
toolbarItem.paletteLabel = toolbarItem.label toolbarItem.paletteLabel = toolbarItem.label
toolbarItem.image = NSImage(named: toolbarItemSpec.imageName) toolbarItem.image = toolbarItemSpec.image
return toolbarItem return toolbarItem
} }

View File

@ -1,12 +0,0 @@
{
"images" : [
{
"filename" : "globe.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}