Browse Source

Minor adjustments.

pull/92/head
Abhishek 4 years ago
parent
commit
a9607762be
  1. 8
      Clocker/Preferences/General/PreferencesViewController.swift

8
Clocker/Preferences/General/PreferencesViewController.swift

@ -628,7 +628,10 @@ extension PreferencesViewController {
CLCustomLabel: filteredAddress, CLCustomLabel: filteredAddress,
] as [String: Any] ] as [String: Any]
// Mark if the timezone is same as local timezone
let timezoneObject = TimezoneData(with: newTimeZone) let timezoneObject = TimezoneData(with: newTimeZone)
timezoneObject.isSystemTimezone = timezoneObject.timezoneID == NSTimeZone.system.identifier
let operationsObject = TimezoneDataOperations(with: timezoneObject) let operationsObject = TimezoneDataOperations(with: timezoneObject)
operationsObject.saveObject() operationsObject.saveObject()
@ -680,6 +683,7 @@ extension PreferencesViewController {
comment: "Search Field Placeholder") comment: "Search Field Placeholder")
availableTimezoneTableView.isHidden = false availableTimezoneTableView.isHidden = false
isActivityInProgress = false isActivityInProgress = false
selectNewlyInsertedTimezone()
} }
@IBAction func addTimeZone(_: NSButton) { @IBAction func addTimeZone(_: NSButton) {
@ -801,6 +805,10 @@ extension PreferencesViewController {
availableTimezoneTableView.isHidden = false availableTimezoneTableView.isHidden = false
isActivityInProgress = false isActivityInProgress = false
selectNewlyInsertedTimezone()
}
private func selectNewlyInsertedTimezone() {
// Let's highlight the newly added row. If the number of timezones is greater than 6, the newly added timezone isn't visible. Since we hide the scrollbars as well, the user might get the impression that something is broken! // Let's highlight the newly added row. If the number of timezones is greater than 6, the newly added timezone isn't visible. Since we hide the scrollbars as well, the user might get the impression that something is broken!
if timezoneTableView.numberOfRows > 6 { if timezoneTableView.numberOfRows > 6 {
timezoneTableView.scrollRowToVisible(timezoneTableView.numberOfRows - 1) timezoneTableView.scrollRowToVisible(timezoneTableView.numberOfRows - 1)

Loading…
Cancel
Save