Browse Source

Merge branch 'master' of https://github.com/n0shake/Clocker

pull/92/head
Abhishek 5 years ago
parent
commit
bd71ad28c5
  1. 6
      Clocker/Clocker.xcodeproj/project.pbxproj
  2. 4
      Clocker/Clocker/Clocker-Info.plist
  3. 2
      Clocker/ClockerUITests/AboutUsTests.swift
  4. 6
      Clocker/ClockerUITests/PreferencesTest.swift
  5. 2
      Clocker/ClockerUnitTests/ClockerUnitTests.swift
  6. 18
      Clocker/Panel/ParentPanelController.swift
  7. 5
      Clocker/Panel/UI/TimezoneDataSource.swift

6
Clocker/Clocker.xcodeproj/project.pbxproj

@ -1442,6 +1442,7 @@
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 74;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
@ -1466,6 +1467,7 @@
INFOPLIST_FILE = "Clocker/Clocker-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 1.6.19;
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.abhishek.Clocker;
PRODUCT_NAME = Clocker;
@ -1925,6 +1927,7 @@
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 74;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
@ -1950,6 +1953,7 @@
INFOPLIST_FILE = "Clocker/Clocker-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 1.6.19;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "";
"OTHER_SWIFT_FLAGS[arch=*]" = "-D DEBUG";
@ -1985,6 +1989,7 @@
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 74;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
@ -2009,6 +2014,7 @@
INFOPLIST_FILE = "Clocker/Clocker-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 1.6.19;
OTHER_LDFLAGS = "";
"OTHER_SWIFT_FLAGS[arch=*]" = "-D RELEASE";
PRODUCT_BUNDLE_IDENTIFIER = com.abhishek.Clocker;

4
Clocker/Clocker/Clocker-Info.plist

@ -13,11 +13,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.6.17</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>72</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>

2
Clocker/ClockerUITests/AboutUsTests.swift

@ -33,7 +33,7 @@ class AboutUsTests: XCTestCase {
tapAboutTab()
let appDisplayName = "CFBundleDisplayName".localizedString()
let expectedVersion = "\(appDisplayName) 1.6.17 (72)"
let expectedVersion = "\(appDisplayName) 1.6.19 (74)"
guard let presentVersion = app.windows["Clocker"].staticTexts["ClockerVersion"].value as? String else {
XCTFail("Present version not present")
return

6
Clocker/ClockerUITests/PreferencesTest.swift

@ -134,12 +134,6 @@ class PreferencesTest: XCTestCase {
}
XCTAssertEqual(newformattedAddress, formattedAddress)
app.windows["Clocker"].checkBoxes["SortButton"].click()
XCTAssertFalse(app.windows["Clocker"].checkBoxes["Sort by Time Difference".localizedString()].exists)
XCTAssertFalse(app.windows["Clocker"].checkBoxes["Sort by Label".localizedString()].exists)
XCTAssertFalse(app.windows["Clocker"].checkBoxes["Sort by Name".localizedString()].exists)
}
func testSortingCitiesByCustomLabel() {

2
Clocker/ClockerUnitTests/ClockerUnitTests.swift

@ -157,7 +157,7 @@ class ClockerUnitTests: XCTestCase {
XCTAssertTrue(operations.timeDifference() == ", 12 hours 30 mins ahead", "Difference was unexpectedly: \(operations.timeDifference())")
XCTAssertTrue(californiaOperations.timeDifference() == "", "Difference was unexpectedly: \(californiaOperations.timeDifference())")
XCTAssertTrue(floridaOperations.timeDifference() == ", 3 hours ahead", "Difference was unexpectedly: \(floridaOperations.timeDifference())")
XCTAssertTrue(aucklandOperations.timeDifference() == ", 20 hours ahead", "Difference was unexpectedly: \(aucklandOperations.timeDifference())")
XCTAssertTrue(aucklandOperations.timeDifference() == ", 21 hours ahead", "Difference was unexpectedly: \(aucklandOperations.timeDifference())")
XCTAssertTrue(omahaOperations.timeDifference() == ", 2 hours ahead", "Difference was unexpectedly: \(omahaOperations.timeDifference())")
}

18
Clocker/Panel/ParentPanelController.swift

@ -359,25 +359,27 @@ class ParentPanelController: NSWindowController {
}
private func getAdjustedRowHeight(for object: TimezoneData?, _ currentHeight: CGFloat) -> CGFloat {
let userFontSize: NSNumber = DataStore.shared().retrieve(key: CLUserFontSizePreference) as? NSNumber ?? 4
var newHeight = currentHeight
if newHeight <= 68.0 {
newHeight = 68.0
newHeight = 60.0
}
if newHeight >= 68.0 {
newHeight = 72.0
newHeight = userFontSize == 4 ? 68.0 : 68.0
if let note = object?.note, note.isEmpty == false {
newHeight += 25
newHeight += 20
}
}
if newHeight >= 88.0 {
// Set it to 90 expicity in case the row height is calculated be higher.
newHeight = 90.0
newHeight = 88.0
if let note = object?.note, note.isEmpty {
newHeight -= 25.0
newHeight -= 20.0
}
}
@ -403,7 +405,11 @@ class ParentPanelController: NSWindowController {
}
if let userFontSize = DataStore.shared().retrieve(key: CLUserFontSizePreference) as? NSNumber {
scrollViewHeight.constant = totalHeight + CGFloat(userFontSize.intValue * 2) + 5.0
if userFontSize == 4 {
scrollViewHeight.constant = totalHeight + CGFloat(userFontSize.intValue * 2)
} else {
scrollViewHeight.constant = totalHeight + CGFloat(userFontSize.intValue * 2) * 3.0
}
}
if DataStore.shared().shouldDisplay(ViewType.upcomingEventView) {

5
Clocker/Panel/UI/TimezoneDataSource.swift

@ -78,11 +78,12 @@ extension TimezoneDataSource: NSTableViewDataSource, NSTableViewDelegate {
if let userFontSize = DataStore.shared().retrieve(key: CLUserFontSizePreference) as? NSNumber, timezones.count > row {
let model = timezones[row]
let rowHeight: Int = userFontSize == 4 ? 60 : 65
if let note = model.note, !note.isEmpty {
return CGFloat(65 + userFontSize.floatValue + 25)
return CGFloat(rowHeight + userFontSize.intValue + 25)
}
return CGFloat(65 + (userFontSize.intValue * 2))
return CGFloat(rowHeight + (userFontSize.intValue * 2))
}
return 0

Loading…
Cancel
Save