Browse Source

API switch to remove accessibility descripttion.

pull/92/head
Abhishek 5 years ago
parent
commit
ba7b1cd187
  1. 2
      Clocker/Onboarding/OnboardingParentViewController.swift
  2. 17
      Clocker/Overall App/Themer.swift
  3. 4
      Clocker/Panel/ParentPanelController.swift
  4. 2
      Clocker/Panel/UI/TimezoneDataSource.swift

2
Clocker/Onboarding/OnboardingParentViewController.swift

@ -71,7 +71,7 @@ class OnboardingParentViewController: NSViewController {
if #available(OSX 10.16, *) {
negativeButton.controlSize = .large
positiveButton.controlSize = .large
backButton.image = Themer.shared().symbolImage(for: "chevron.left.circle.fill", accessibilityDescription: "back-button")
backButton.image = Themer.shared().symbolImage(for: "chevron.left.circle.fill")
backButton.bezelStyle = .recessed
backButton.isBordered = false
backButton.font = NSFont.systemFont(ofSize: 24)

17
Clocker/Overall App/Themer.swift

@ -152,7 +152,7 @@ extension Themer {
func shutdownImage() -> NSImage {
if #available(macOS 10.16, *) {
return symbolImage(for: "ellipsis.circle", nil)
return symbolImage(for: "ellipsis.circle")
}
if #available(macOS 10.14, *) {
@ -171,7 +171,7 @@ extension Themer {
func preferenceImage() -> NSImage {
if #available(macOS 10.16, *) {
return symbolImage(for: "gear", nil)
return symbolImage(for: "gear")
}
if #available(macOS 10.14, *) {
@ -193,7 +193,7 @@ extension Themer {
func pinImage() -> NSImage {
if #available(macOS 10.16, *) {
return symbolImage(for: "macwindow.on.rectangle", nil)
return symbolImage(for: "macwindow.on.rectangle")
}
if #available(macOS 10.14, *) {
@ -317,7 +317,7 @@ extension Themer {
func sharingImage() -> NSImage {
if #available(macOS 10.16, *) {
return symbolImage(for: "square.and.arrow.up.on.square.fill", nil)
return symbolImage(for: "square.and.arrow.up.on.square.fill")
}
if #available(macOS 10.14, *) {
@ -445,9 +445,14 @@ extension Themer {
NSColor(deviceRed: 42.0 / 255.0, green: 55.0 / 255.0, blue: 62.0 / 255.0, alpha: 1.0)
}
func symbolImage(for _: String, _: String?) -> NSImage {
func symbolImage(for name: String) -> NSImage {
assert(name.count > 0)
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"))!
// return NSImage(systemSymbolName: name, accessibilityDescription: accessibilityDescription)!
}
}
}

4
Clocker/Panel/ParentPanelController.swift

@ -167,9 +167,11 @@ class ParentPanelController: NSWindowController {
showDebugVersionViewIfNeccesary()
#if DEBUG
if #available(macOS 10.16, *) {
// mainTableView.style = .fullWidth
mainTableView.style = .fullWidth
}
#endif
}
private func showDebugVersionViewIfNeccesary() {

2
Clocker/Panel/UI/TimezoneDataSource.swift

@ -136,7 +136,7 @@ extension TimezoneDataSource: NSTableViewDataSource, NSTableViewDelegate {
})
if #available(OSX 10.16, *) {
swipeToDelete.image = Themer.shared().symbolImage(for: "trash.fill", "Trash Button")
swipeToDelete.image = Themer.shared().symbolImage(for: "trash.fill")
} else {
swipeToDelete.image = NSImage(named: NSImage.Name("Trash"))

Loading…
Cancel
Save