Browse Source

Add icon for Copy All Times.

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

18
Clocker/Overall App/Themer.swift

@ -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") {

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