Skip to content

Commit

Permalink
Add icon for Copy All Times.
Browse files Browse the repository at this point in the history
  • Loading branch information
n0shake committed Apr 23, 2023
1 parent 4a6baed commit e7e7ee3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
18 changes: 17 additions & 1 deletion Clocker/Overall App/Themer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,29 @@ extension Themer {
return retrieveCurrentSystem() == .dark ? NSImage(named: NSImage.Name("Dark Menubar"))! : NSImage(named: NSImage.Name("Light Menubar"))!
}

func extraOptionsHighlightedImage() -> NSImage {
func extraOptionsHighlightedImage() -> NSImage {
return fallbackImageProvider(NSImage(named: NSImage.Name("ExtraHighlighted"))!,
NSImage(named: NSImage.Name("ExtraWhiteHighlighted"))!,
NSImage(named: NSImage.Name("ExtraHighlighted Dynamic"))!,
NSImage(named: NSImage.Name("ExtraHighlighted"))!,
NSImage(named: NSImage.Name("ExtraWhiteHighlighted"))!)
}

func copyImage() -> NSImage {
if let copyImage = symbolImage(for: "doc.on.doc") {
return copyImage
}

return NSImage()
}

func highlightedCopyImage() -> NSImage? {
if let copyImage = symbolImage(for: "doc.on.doc.fill") {
return copyImage
}

return nil
}

func sharingImage() -> NSImage {
if let sharingImage = symbolImage(for: "square.and.arrow.up.on.square.fill") {
Expand Down
5 changes: 4 additions & 1 deletion Clocker/Panel/ParentPanelController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,10 @@ extension ParentPanelController: NSSharingServicePickerDelegate {
}

func sharingServicePicker(_: NSSharingServicePicker, sharingServicesForItems _: [Any], proposedSharingServices proposed: [NSSharingService]) -> [NSSharingService] {
let copySharingService = NSSharingService(title: "Copy All Times", image: NSImage(), alternateImage: nil) { [weak self] in
let themer = Themer.shared()
let copySharingService = NSSharingService(title: "Copy All Times",
image:themer.copyImage(),
alternateImage: themer.highlightedCopyImage()) { [weak self] in
guard let strongSelf = self else { return }
let clipboardCopy = strongSelf.retrieveAllTimes()
let pasteboard = NSPasteboard.general
Expand Down

0 comments on commit e7e7ee3

Please sign in to comment.