Browse Source

Add icon for Copy All Times.

master
Abhi 2 years ago
parent
commit
e7e7ee3cff
  1. 16
      Clocker/Overall App/Themer.swift
  2. 5
      Clocker/Panel/ParentPanelController.swift

16
Clocker/Overall App/Themer.swift

@ -278,6 +278,22 @@ extension Themer {
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") {
return sharingImage

5
Clocker/Panel/ParentPanelController.swift

@ -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

Loading…
Cancel
Save