From 2759a3306cf8292e51e37588039d8bff302a99fe Mon Sep 17 00:00:00 2001 From: Abhishek Date: Sat, 2 Nov 2019 09:27:25 -0700 Subject: [PATCH] Font is slightly smaller. --- Clocker/Clocker.xcodeproj/project.pbxproj | 6 ++++++ Clocker/Clocker/Clocker-Info.plist | 4 ++-- Clocker/ClockerUITests/AboutUsTests.swift | 2 +- Clocker/ClockerUITests/PreferencesTest.swift | 6 ------ .../ClockerUnitTests/ClockerUnitTests.swift | 2 +- Clocker/Panel/ParentPanelController.swift | 18 ++++++++++++------ Clocker/Panel/UI/TimezoneDataSource.swift | 5 +++-- 7 files changed, 25 insertions(+), 18 deletions(-) diff --git a/Clocker/Clocker.xcodeproj/project.pbxproj b/Clocker/Clocker.xcodeproj/project.pbxproj index 97c3e30..8ee1127 100755 --- a/Clocker/Clocker.xcodeproj/project.pbxproj +++ b/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; diff --git a/Clocker/Clocker/Clocker-Info.plist b/Clocker/Clocker/Clocker-Info.plist index 5246004..94e2489 100755 --- a/Clocker/Clocker/Clocker-Info.plist +++ b/Clocker/Clocker/Clocker-Info.plist @@ -13,11 +13,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.6.17 + $(MARKETING_VERSION) CFBundleSignature ???? CFBundleVersion - 72 + $(CURRENT_PROJECT_VERSION) Fabric APIKey diff --git a/Clocker/ClockerUITests/AboutUsTests.swift b/Clocker/ClockerUITests/AboutUsTests.swift index 794628a..d64b655 100644 --- a/Clocker/ClockerUITests/AboutUsTests.swift +++ b/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 diff --git a/Clocker/ClockerUITests/PreferencesTest.swift b/Clocker/ClockerUITests/PreferencesTest.swift index 4a4da59..91c9fad 100644 --- a/Clocker/ClockerUITests/PreferencesTest.swift +++ b/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() { diff --git a/Clocker/ClockerUnitTests/ClockerUnitTests.swift b/Clocker/ClockerUnitTests/ClockerUnitTests.swift index 18cf233..c65fe11 100644 --- a/Clocker/ClockerUnitTests/ClockerUnitTests.swift +++ b/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())") } diff --git a/Clocker/Panel/ParentPanelController.swift b/Clocker/Panel/ParentPanelController.swift index 5f5ba3d..00cd156 100644 --- a/Clocker/Panel/ParentPanelController.swift +++ b/Clocker/Panel/ParentPanelController.swift @@ -355,25 +355,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 } } @@ -399,7 +401,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) { diff --git a/Clocker/Panel/UI/TimezoneDataSource.swift b/Clocker/Panel/UI/TimezoneDataSource.swift index eb9f7bd..7960c34 100644 --- a/Clocker/Panel/UI/TimezoneDataSource.swift +++ b/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