From 68b152c669a13d1b23273adb15b25bfe85122823 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Fri, 26 Jun 2020 22:56:05 -0500 Subject: [PATCH] Update to SF Symbol image! --- Clocker/Overall App/Themer.swift | 14 ++++++++++++-- Clocker/Panel/UI/TimezoneDataSource.swift | 7 ++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Clocker/Overall App/Themer.swift b/Clocker/Overall App/Themer.swift index 8a0d030..e5957cc 100644 --- a/Clocker/Overall App/Themer.swift +++ b/Clocker/Overall App/Themer.swift @@ -166,6 +166,11 @@ extension Themer { } func preferenceImage() -> NSImage { + if #available(macOS 10.16, *) { + return NSImage(systemSymbolName: "gear", + accessibilityDescription: nil)! + } + if #available(macOS 10.14, *) { switch themeIndex { case .light: @@ -177,7 +182,10 @@ extension Themer { } } - return themeIndex == .light ? NSImage(named: NSImage.Name("Settings"))! : NSImage(named: NSImage.Name("Settings-White"))! + return + themeIndex == .light + ? NSImage(named: NSImage.Name("Settings"))! + : NSImage(named: NSImage.Name("Settings-White"))! } func pinImage() -> NSImage { @@ -192,7 +200,9 @@ extension Themer { } } - return themeIndex == .light ? NSImage(named: NSImage.Name("Float"))! : NSImage(named: NSImage.Name("Float-White"))! + return themeIndex == .light + ? NSImage(named: NSImage.Name("Float"))! + : NSImage(named: NSImage.Name("Float-White"))! } func sunriseImage() -> NSImage { diff --git a/Clocker/Panel/UI/TimezoneDataSource.swift b/Clocker/Panel/UI/TimezoneDataSource.swift index beaab76..18226e5 100644 --- a/Clocker/Panel/UI/TimezoneDataSource.swift +++ b/Clocker/Panel/UI/TimezoneDataSource.swift @@ -136,7 +136,12 @@ extension TimezoneDataSource: NSTableViewDataSource, NSTableViewDelegate { }) - swipeToDelete.image = NSImage(named: NSImage.Name("Trash")) + if #available(OSX 10.16, *) { + swipeToDelete.image = NSImage(systemSymbolName: "trash.fill", + accessibilityDescription: nil) + } else { + swipeToDelete.image = NSImage(named: NSImage.Name("Trash")) + } return [swipeToDelete] }