Browse Source

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

pull/92/head
Abhishek 4 years ago
parent
commit
323e8be1cb
  1. 2
      Clocker/AppDelegate.swift
  2. 9
      Clocker/Clocker.xcodeproj/project.pbxproj
  3. 2
      Clocker/ClockerUITests/AboutUsTests.swift
  4. 13
      Clocker/ClockerUITests/FloatingWindowTests.swift
  5. 38
      Clocker/Media.xcassets/Accent Color.colorset/Contents.json
  6. 6
      Clocker/Media.xcassets/Contents.json
  7. 13
      Clocker/Onboarding/Onboarding.storyboard
  8. 4
      Clocker/Onboarding/OnboardingParentViewController.swift
  9. 4
      Clocker/Panel/Notes Popover/NotesPopover.swift
  10. 25
      Clocker/Panel/Notes Popover/NotesPopover.xib
  11. 2
      Clocker/Panel/UI/TimezoneDataSource.swift

2
Clocker/AppDelegate.swift

@ -113,7 +113,7 @@ open class AppDelegate: NSObject, NSApplicationDelegate {
let shouldLaunchOnboarding = (DataStore.shared().retrieve(key: CLShowOnboardingFlow) == nil && DataStore.shared().timezones().isEmpty)
|| ProcessInfo.processInfo.arguments.contains(CLOnboaringTestsLaunchArgument)
shouldLaunchOnboarding ? controller?.launch() : continueUsually()
shouldLaunchOnboarding ? controller?.launch() : controller?.launch()
}
func continueUsually() {

9
Clocker/Clocker.xcodeproj/project.pbxproj

@ -81,7 +81,6 @@
35C36FA12259ED6D002FA5C6 /* EventCenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35C36F9E2259ED6D002FA5C6 /* EventCenter.swift */; };
35C36FA22259ED6D002FA5C6 /* RemindersHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35C36F9F2259ED6D002FA5C6 /* RemindersHandler.swift */; };
35C36FA42259EEC2002FA5C6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35C36FA32259EEC2002FA5C6 /* AppDelegate.swift */; };
35E05E4424621A40008CA0A9 /* Keys.plist in Resources */ = {isa = PBXBuildFile; fileRef = 35E05E4324621A40008CA0A9 /* Keys.plist */; };
9A0A1C8C20903DBD0012003B /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A9E87651C1FEDC500A7A2DF /* CoreLocation.framework */; };
9A13BAD61CA87F08007C6CBE /* Panel.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9A13BAD81CA87F08007C6CBE /* Panel.xib */; };
9A13BAE01CA882FA007C6CBE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9A13BAE21CA882FA007C6CBE /* InfoPlist.strings */; };
@ -300,7 +299,7 @@
35C36F9E2259ED6D002FA5C6 /* EventCenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EventCenter.swift; sourceTree = "<group>"; };
35C36F9F2259ED6D002FA5C6 /* RemindersHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RemindersHandler.swift; sourceTree = "<group>"; };
35C36FA32259EEC2002FA5C6 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = SOURCE_ROOT; };
35E05E4324621A40008CA0A9 /* Keys.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Keys.plist; path = ../Internal/Keys.plist; sourceTree = "<group>"; };
35E2A6D324A6E4F300D2773B /* Keys.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Keys.plist; path = Internal/Keys.plist; sourceTree = "<group>"; };
9A13BAD71CA87F08007C6CBE /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/Panel.xib; sourceTree = "<group>"; };
9A13BAE11CA882FA007C6CBE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
9A13BAEB1CA88A76007C6CBE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
@ -821,7 +820,7 @@
DD4F7BF913C30F9F00825C6E = {
isa = PBXGroup;
children = (
35E05E4324621A40008CA0A9 /* Keys.plist */,
35E2A6D324A6E4F300D2773B /* Keys.plist */,
35C36F9B2259EC97002FA5C6 /* Events and Reminders */,
35C36F382259D80C002FA5C6 /* Overall App */,
35C36F242259D64D002FA5C6 /* Panel */,
@ -1115,7 +1114,6 @@
9A13BAD61CA87F08007C6CBE /* Panel.xib in Resources */,
35C36F6B2259E0E1002FA5C6 /* FloatingWindow.xib in Resources */,
35C36F17225961DA002FA5C6 /* DateTools.bundle in Resources */,
35E05E4424621A40008CA0A9 /* Keys.plist in Resources */,
35C36EF322595F14002FA5C6 /* WelcomeView.xib in Resources */,
35C36EF822595F14002FA5C6 /* Onboarding.storyboard in Resources */,
35C36F612259DE67002FA5C6 /* NotesPopover.xib in Resources */,
@ -1440,6 +1438,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = "Accent Color";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
@ -1925,6 +1924,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = "Accent Color";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
@ -1988,6 +1988,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = "Accent Color";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;

2
Clocker/ClockerUITests/AboutUsTests.swift

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

13
Clocker/ClockerUITests/FloatingWindowTests.swift

@ -4,7 +4,7 @@ import XCTest
extension String {
func localizedString() -> String {
let bundle = Bundle(for: AboutUsTests.self)
let bundle = Bundle(for: FloatingWindowTests.self)
return NSLocalizedString(self, bundle: bundle, comment: "")
}
}
@ -111,6 +111,10 @@ class FloatingWindowTests: XCTestCase {
let appearanceTab = app.toolbars.buttons.element(boundBy: 1)
appearanceTab.click()
// Select Misc tab
let miscTab = app.tabs.element(boundBy: 1)
miscTab.click()
if floatingSlider {
app.radioGroups["FutureSlider"].radioButtons["No"].click()
} else {
@ -141,6 +145,10 @@ class FloatingWindowTests: XCTestCase {
let appearanceTab = app.toolbars.buttons.element(boundBy: 1)
appearanceTab.click()
// Select Misc tab
let miscTab = app.tabs.element(boundBy: 1)
miscTab.click()
XCTAssertTrue(app.staticTexts["InformationLabel"].exists)
let generalTab = app.toolbars.buttons.element(boundBy: 0)
@ -153,6 +161,7 @@ class FloatingWindowTests: XCTestCase {
XCTAssertFalse(app.staticTexts["InformationLabel"].exists)
}
/// Make sure to ensure supplementary/relative date label is turned on!
func testMovingSlider() {
if app.buttons["Pin"].exists {
app.buttons["Pin"].click()
@ -161,7 +170,7 @@ class FloatingWindowTests: XCTestCase {
let floatingSlider = app.sliders["FloatingSlider"].exists
if floatingSlider {
let tomorrowPredicate = NSPredicate(format: "placeholderValue like %@", "Tomorrow")
let tomorrowPredicate = NSPredicate(format: "identifier like %@", "RelativeDate")
let tomorrow = app.tables.tableRows.staticTexts.matching(tomorrowPredicate)
var previousValues: [String] = []

38
Clocker/Media.xcassets/Accent Color.colorset/Contents.json

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "extended-srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.999",
"green" : "0.000",
"red" : "0.092"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "extended-srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.109",
"green" : "0.958",
"red" : "0.071"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

6
Clocker/Media.xcassets/Contents.json

@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}

13
Clocker/Onboarding/Onboarding.storyboard

@ -437,7 +437,7 @@ DQ
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ClockerIcon-512" id="bjq-tD-CZ4"/>
</imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2ra-RP-SYR">
<rect key="frame" x="120" y="311" width="94" height="16"/>
<rect key="frame" x="120" y="304" width="94" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" placeholderString="Onboarding Info" id="SIV-aM-Wjg">
<font key="font" size="12" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -445,7 +445,7 @@ DQ
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hqW-RG-UOt">
<rect key="frame" x="118" y="322" width="203" height="45"/>
<rect key="frame" x="118" y="315" width="203" height="45"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="left" placeholderString="Screen Name" id="QDu-mo-gtb">
<font key="font" size="33" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -573,22 +573,17 @@ DQ
</button>
</subviews>
<constraints>
<constraint firstItem="wDx-nO-z0M" firstAttribute="top" secondItem="30y-X6-i7I" secondAttribute="bottom" constant="2" id="4og-pY-dHR"/>
<constraint firstItem="2ra-RP-SYR" firstAttribute="leading" secondItem="hqW-RG-UOt" secondAttribute="leading" constant="2" id="7mH-Ln-u0a"/>
<constraint firstItem="16a-9S-3hj" firstAttribute="leading" secondItem="r3Q-VK-VHF" secondAttribute="leading" constant="20" id="9fu-69-cfH"/>
<constraint firstItem="RGd-Ev-FdZ" firstAttribute="leading" secondItem="r3Q-VK-VHF" secondAttribute="leading" constant="20" id="ApV-Wr-6Gy"/>
<constraint firstItem="D2w-fr-zQp" firstAttribute="top" secondItem="16a-9S-3hj" secondAttribute="bottom" constant="30" id="Hmb-4J-wVF"/>
<constraint firstItem="2ra-RP-SYR" firstAttribute="top" secondItem="hqW-RG-UOt" secondAttribute="bottom" constant="-5" id="N5D-cY-fuJ"/>
<constraint firstItem="RGd-Ev-FdZ" firstAttribute="top" secondItem="D2w-fr-zQp" secondAttribute="bottom" constant="26" id="Un4-zl-ZCZ"/>
<constraint firstItem="hqW-RG-UOt" firstAttribute="centerY" secondItem="16a-9S-3hj" secondAttribute="centerY" constant="-10" id="Z0R-lN-mSQ"/>
<constraint firstItem="D2w-fr-zQp" firstAttribute="leading" secondItem="r3Q-VK-VHF" secondAttribute="leading" constant="20" id="fut-DD-1Uj"/>
<constraint firstAttribute="trailing" secondItem="D2w-fr-zQp" secondAttribute="trailing" constant="20" id="g4d-q3-JXg"/>
<constraint firstAttribute="trailing" secondItem="51r-DX-fZU" secondAttribute="trailing" constant="20" id="ixH-7I-UQ5"/>
<constraint firstItem="wDx-nO-z0M" firstAttribute="leading" secondItem="r3Q-VK-VHF" secondAttribute="leading" constant="22" id="kbZ-Gb-IFo"/>
<constraint firstItem="51r-DX-fZU" firstAttribute="centerY" secondItem="wDx-nO-z0M" secondAttribute="centerY" id="nPE-UG-l8T"/>
<constraint firstItem="16a-9S-3hj" firstAttribute="top" secondItem="r3Q-VK-VHF" secondAttribute="top" constant="20" id="p9J-gq-Fqy"/>
<constraint firstItem="hqW-RG-UOt" firstAttribute="top" secondItem="16a-9S-3hj" secondAttribute="top" id="sQX-el-0aw"/>
<constraint firstAttribute="trailing" secondItem="RGd-Ev-FdZ" secondAttribute="trailing" constant="20" id="sSL-Ae-eYf"/>
<constraint firstItem="51r-DX-fZU" firstAttribute="leading" secondItem="wDx-nO-z0M" secondAttribute="trailing" id="waW-dn-Plp"/>
<constraint firstItem="hqW-RG-UOt" firstAttribute="leading" secondItem="16a-9S-3hj" secondAttribute="trailing" constant="20" id="yQc-Ub-zMT"/>
</constraints>
</view>
@ -603,7 +598,7 @@ DQ
</viewController>
<customObject id="VtX-cF-vU0" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1984.5" y="749.5"/>
<point key="canvasLocation" x="1984" y="749.5"/>
</scene>
<!--Final Onboarding View Controller-->
<scene sceneID="5L4-Km-YMW">

4
Clocker/Onboarding/OnboardingParentViewController.swift

@ -69,8 +69,8 @@ class OnboardingParentViewController: NSViewController {
[negativeButton, backButton].forEach { $0?.isHidden = true }
if #available(OSX 10.16, *) {
// negativeButton.controlSize = .large
// positiveButton.controlSize = .large
// negativeButton.controlSize = .large
// positiveButton.controlSize = .large
backButton.image = Themer.shared().symbolImage(for: "chevron.left.circle.fill", "back-button")
} else {
backButton.title = NSLocalizedString("Back",

4
Clocker/Panel/Notes Popover/NotesPopover.swift

@ -75,6 +75,10 @@ class NotesPopover: NSViewController {
setReminderCheckbox.setAccessibilityIdentifier("ReminderCheckbox")
alertPopupButton.setAccessibilityIdentifier("RemindersAlertPopup")
reminderView.setAccessibilityIdentifier("RemindersView")
if #available(macOS 10.16, *) {
alertPopupButton.controlSize = .large
}
}
override func viewWillAppear() {

25
Clocker/Panel/Notes Popover/NotesPopover.xib

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17132" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17132"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@ -87,7 +87,7 @@
<constraint firstAttribute="height" constant="22" id="wGh-4g-gQ3"/>
</constraints>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="CUSTOMIZE" id="AWQ-XX-6Ai">
<font key="font" metaFont="toolTip"/>
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -187,7 +187,7 @@
<rect key="frame" x="0.0" y="137" width="300" height="60"/>
<subviews>
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="seL-7y-MOc">
<rect key="frame" x="18" y="10" width="265" height="24"/>
<rect key="frame" x="18" y="11" width="265" height="24"/>
<segmentedCell key="cell" borderStyle="border" alignment="left" style="rounded" trackingMode="selectOne" id="Low-Q8-K5h">
<font key="font" size="12" name="Avenir-Book"/>
<segments>
@ -201,9 +201,9 @@
</connections>
</segmentedControl>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Wqz-cF-lhm">
<rect key="frame" x="18" y="35" width="274" height="14"/>
<rect key="frame" x="18" y="36" width="274" height="14"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="left" title="Timezone Format" id="JnF-g8-GLM">
<font key="font" metaFont="toolTip"/>
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -224,7 +224,7 @@
<rect key="frame" x="0.0" y="77" width="300" height="60"/>
<subviews>
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="eiB-dp-56X">
<rect key="frame" x="18" y="10" width="265" height="24"/>
<rect key="frame" x="18" y="11" width="265" height="24"/>
<segmentedCell key="cell" borderStyle="border" alignment="left" style="rounded" trackingMode="selectOne" id="E2D-Y2-kok">
<font key="font" size="12" name="Avenir-Book"/>
<segments>
@ -238,9 +238,9 @@
</connections>
</segmentedControl>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="WVk-sH-CqF">
<rect key="frame" x="18" y="35" width="274" height="14"/>
<rect key="frame" x="18" y="36" width="274" height="14"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="left" title="Display Seconds" id="lCg-ZI-gIk">
<font key="font" metaFont="toolTip"/>
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -324,7 +324,7 @@
</constraints>
</progressIndicator>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9hd-54-hYl">
<rect key="frame" x="103" y="-2" width="132" height="36"/>
<rect key="frame" x="102" y="-2" width="134" height="37"/>
<constraints>
<constraint firstAttribute="height" constant="25" id="8tH-mx-HuL"/>
<constraint firstAttribute="width" constant="120" id="gn2-zr-ZRp"/>
@ -338,7 +338,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qgx-Yf-bP8">
<rect key="frame" x="233" y="-2" width="62" height="36"/>
<rect key="frame" x="232" y="-2" width="64" height="37"/>
<constraints>
<constraint firstAttribute="width" constant="50" id="n5J-f7-aqy"/>
<constraint firstAttribute="height" constant="25" id="oQ5-uv-Gfg"/>
@ -346,9 +346,6 @@
<buttonCell key="cell" type="push" title="Done" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="xa4-rw-FBZ">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" size="12" name="Avenir-Light"/>
<string key="keyEquivalent" base64-UTF8="YES">
DQ
</string>
</buttonCell>
<accessibility identifier="SaveButton"/>
<connections>

2
Clocker/Panel/UI/TimezoneDataSource.swift

@ -62,6 +62,7 @@ extension TimezoneDataSource: NSTableViewDataSource, NSTableViewDelegate {
cellView.noteLabel.toolTip = currentModel.note ?? CLEmptyString
cellView.currentLocationIndicator.isHidden = !currentModel.isSystemTimezone
cellView.time.setAccessibilityIdentifier("ActualTime")
cellView.relativeDate.setAccessibilityIdentifier("RelativeDate")
cellView.layout(with: currentModel)
cellView.setAccessibilityIdentifier(currentModel.formattedTimezoneLabel())
@ -136,6 +137,7 @@ extension TimezoneDataSource: NSTableViewDataSource, NSTableViewDelegate {
if #available(OSX 10.16, *) {
swipeToDelete.image = Themer.shared().symbolImage(for: "trash.fill", "Trash Button")
} else {
swipeToDelete.image = NSImage(named: NSImage.Name("Trash"))
}

Loading…
Cancel
Save