Browse Source

Use symbol images in 11.0

pull/92/head
Abhishek 4 years ago
parent
commit
cc887bc081
  1. 22
      Clocker/Overall App/Themer.swift

22
Clocker/Overall App/Themer.swift

@ -151,7 +151,7 @@ extension Themer {
} }
func shutdownImage() -> NSImage { func shutdownImage() -> NSImage {
if #available(macOS 10.16, *) { if #available(OSX 11.0, *) {
return symbolImage(for: "ellipsis.circle") return symbolImage(for: "ellipsis.circle")
} }
@ -170,7 +170,7 @@ extension Themer {
} }
func preferenceImage() -> NSImage { func preferenceImage() -> NSImage {
if #available(macOS 10.16, *) { if #available(OSX 11.0, *) {
return symbolImage(for: "gear") return symbolImage(for: "gear")
} }
@ -192,7 +192,7 @@ extension Themer {
} }
func pinImage() -> NSImage { func pinImage() -> NSImage {
if #available(macOS 10.16, *) { if #available(OSX 11.0, *) {
return symbolImage(for: "macwindow.on.rectangle") return symbolImage(for: "macwindow.on.rectangle")
} }
@ -316,7 +316,7 @@ extension Themer {
} }
func sharingImage() -> NSImage { func sharingImage() -> NSImage {
if #available(macOS 10.16, *) { if #available(OSX 11.0, *) {
return symbolImage(for: "square.and.arrow.up.on.square.fill") return symbolImage(for: "square.and.arrow.up.on.square.fill")
} }
@ -447,14 +447,12 @@ extension Themer {
func symbolImage(for name: String) -> NSImage { func symbolImage(for name: String) -> NSImage {
assert(name.count > 0) assert(name.count > 0)
if #available(OSX 11.0, *) {
return NSImage(systemSymbolName: name,
accessibilityDescription: name)!
} else {
// Dummy image for older xcodes
return NSImage(named: NSImage.Name("Calendar Tab Icon"))! return NSImage(named: NSImage.Name("Calendar Tab Icon"))!
// if #available(OSX 10.16, *) { }
// return NSImage(systemSymbolName: name,
// accessibilityDescription: name)!
// } else {
// // Dummy image for older xcodes
// return NSImage(named: NSImage.Name("Calendar Tab Icon"))!
// }
} }
} }

Loading…
Cancel
Save