Skip to content

Commit

Permalink
Use macOS native icon image for folder and pinned item
Browse files Browse the repository at this point in the history
  • Loading branch information
hjx胡继续 committed May 9, 2020
1 parent 302d775 commit 10467e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Clipy/Sources/Services/MenuManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ final class MenuService: NSObject {
// StatusMenu
fileprivate var statusItem: NSStatusItem?
// Icon Cache
fileprivate let folderIcon = Asset.iconFolder.image.iconize(true)
fileprivate let folderIcon = NSImage(named: NSImage.folderName)!.iconize(false)
fileprivate let snippetIcon = Asset.iconSnippet.image.iconize(true)
fileprivate let textIcon = Asset.iconText.image.iconize(true)
fileprivate let pinIcon = Asset.iconPin.image.iconize(true)
fileprivate let pinIcon = NSImage(named: NSImage.lockLockedTemplateName)!.iconize(true)
// Other
fileprivate let disposeBag = DisposeBag()
fileprivate let notificationCenter = NotificationCenter.default
Expand Down Expand Up @@ -483,8 +483,8 @@ private extension NSMenu {
}

private extension NSImage {
func iconize(_ template: Bool = false) -> NSImage {
let image = self.resizeImage(15, 15)
func iconize(_ template: Bool = false, _ size: CGFloat = 18) -> NSImage {
let image = self.resizeImage(size, size)
image?.isTemplate = template
return image!
}
Expand Down

0 comments on commit 10467e0

Please sign in to comment.