mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-02 03:56:55 +01:00
Tweak the new preference pane.
This commit is contained in:
parent
429ba1aed3
commit
fed8fbce98
@ -77,6 +77,12 @@ struct AppAssets {
|
||||
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 = {
|
||||
return RSImage(named: "faviconTemplateImage")!
|
||||
}()
|
||||
|
@ -12,12 +12,12 @@ private struct PreferencesToolbarItemSpec {
|
||||
|
||||
let identifier: NSToolbarItem.Identifier
|
||||
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.name = name
|
||||
self.imageName = imageName
|
||||
self.image = image
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,16 +34,24 @@ class PreferencesWindowController : NSWindowController, NSToolbarDelegate {
|
||||
private var viewControllers = [String: NSViewController]()
|
||||
private let toolbarItemSpecs: [PreferencesToolbarItemSpec] = {
|
||||
var specs = [PreferencesToolbarItemSpec]()
|
||||
specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.General, name: NSLocalizedString("General", comment: "Preferences"), imageName: NSImage.preferencesGeneralName)]
|
||||
specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Accounts, name: NSLocalizedString("Accounts", comment: "Preferences"), imageName: NSImage.userAccountsName)]
|
||||
specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.FeedProvider, name: NSLocalizedString("Providers", comment: "Preferences"), imageName: "feedProviderToolbar")]
|
||||
specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.General,
|
||||
name: NSLocalizedString("General", comment: "Preferences"),
|
||||
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
|
||||
// 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
|
||||
// of the content in this tab.
|
||||
#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
|
||||
return specs
|
||||
}()
|
||||
@ -86,7 +94,7 @@ class PreferencesWindowController : NSWindowController, NSToolbarDelegate {
|
||||
toolbarItem.target = self
|
||||
toolbarItem.label = toolbarItemSpec.name
|
||||
toolbarItem.paletteLabel = toolbarItem.label
|
||||
toolbarItem.image = NSImage(named: toolbarItemSpec.imageName)
|
||||
toolbarItem.image = toolbarItemSpec.image
|
||||
|
||||
return toolbarItem
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "globe.pdf",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user