Browse Source

Make things more readable.

pull/113/head
Abhishek 3 years ago
parent
commit
33623d4bbc
  1. 5
      Clocker/Onboarding/OnboardingSearchController.swift
  2. 5
      Clocker/Panel/UI/TimezoneDataSource.swift
  3. 1
      Clocker/Panel/Upcoming Events/UpcomingEventsDataSource.swift
  4. 9
      Clocker/Preferences/App Feedback/AppFeedbackWindowController.swift

5
Clocker/Onboarding/OnboardingSearchController.swift

@ -445,7 +445,10 @@ extension OnboardingSearchController: NSTableViewDataSource {
} }
func tableView(_ tableView: NSTableView, viewFor _: NSTableColumn?, row: Int) -> NSView? { func tableView(_ tableView: NSTableView, viewFor _: NSTableColumn?, row: Int) -> NSView? {
if let result = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "resultCellView"), owner: self) as? ResultTableViewCell, row >= 0, row < searchResultsDataSource.resultsCount() { if let result = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "resultCellView"), owner: self) as? ResultTableViewCell,
row >= 0,
row < searchResultsDataSource.resultsCount()
{
let currentSelection = searchResultsDataSource.retrieveResult(row) let currentSelection = searchResultsDataSource.retrieveResult(row)
if let timezone = currentSelection as? TimezoneMetadata { if let timezone = currentSelection as? TimezoneMetadata {
result.result.stringValue = " \(timezone.formattedName)" result.result.stringValue = " \(timezone.formattedName)"

5
Clocker/Panel/UI/TimezoneDataSource.swift

@ -85,7 +85,10 @@ extension TimezoneDataSource: NSTableViewDataSource, NSTableViewDelegate {
return 100 return 100
} }
if let userFontSize = DataStore.shared().retrieve(key: CLUserFontSizePreference) as? NSNumber, timezones.count > row, let relativeDisplay = DataStore.shared().retrieve(key: CLRelativeDateKey) as? NSNumber { if let userFontSize = DataStore.shared().retrieve(key: CLUserFontSizePreference) as? NSNumber,
timezones.count > row,
let relativeDisplay = DataStore.shared().retrieve(key: CLRelativeDateKey) as? NSNumber
{
let model = timezones[row] let model = timezones[row]
let shouldShowSunrise = DataStore.shared().shouldDisplay(.sunrise) let shouldShowSunrise = DataStore.shared().shouldDisplay(.sunrise)

1
Clocker/Panel/Upcoming Events/UpcomingEventsDataSource.swift

@ -1,5 +1,6 @@
// Copyright © 2015 Abhishek Banthia // Copyright © 2015 Abhishek Banthia
import AppKit
import Foundation import Foundation
class UpcomingEventsDataSource: NSObject, NSCollectionViewDataSource, NSCollectionViewDelegateFlowLayout { class UpcomingEventsDataSource: NSObject, NSCollectionViewDataSource, NSCollectionViewDelegateFlowLayout {

9
Clocker/Preferences/App Feedback/AppFeedbackWindowController.swift

@ -158,7 +158,14 @@ class AppFeedbackWindowController: NSWindowController {
guard let timezoneObject = TimezoneData.customObject(from: data) else { guard let timezoneObject = TimezoneData.customObject(from: data) else {
return nil return nil
} }
return "Timezone: \(timezoneObject.timezone()) Name: \(timezoneObject.formattedAddress ?? "No") Favourited: \((timezoneObject.isFavourite == 1) ? "Yes" : "No") Note: \(timezoneObject.note ?? "No Note") System: \(timezoneObject.isSystemTimezone ? "Yes" : "No")" let customString = """
Timezone: \(timezoneObject.timezone())
Name: \(timezoneObject.formattedAddress ?? "No")
Favourited: \((timezoneObject.isFavourite == 1) ? "Yes" : "No")
Note: \(timezoneObject.note ?? "No Note")
System: \(timezoneObject.isSystemTimezone ? "Yes" : "No")"
"""
return customString
} }
var relativeDate = "Relative" var relativeDate = "Relative"

Loading…
Cancel
Save