diff --git a/Clocker/ClockerUnitTests/ClockerUnitTests.swift b/Clocker/ClockerUnitTests/ClockerUnitTests.swift index 33e3287a..1e88a88b 100644 --- a/Clocker/ClockerUnitTests/ClockerUnitTests.swift +++ b/Clocker/ClockerUnitTests/ClockerUnitTests.swift @@ -143,11 +143,11 @@ class ClockerUnitTests: XCTestCase { // The below test might fail outside California or if DST is active! // CI is calibrated to be on LA timezone! func testTimeDifference() { - XCTAssertTrue(operations.timeDifference() == ", 9h 30m ahead", "Difference was unexpectedly: \(operations.timeDifference())") - XCTAssertTrue(californiaOperations.timeDifference() == ", 3h behind", "Difference was unexpectedly: \(californiaOperations.timeDifference())") - XCTAssertTrue(floridaOperations.timeDifference() == "", "Difference was unexpectedly: \(floridaOperations.timeDifference())") - XCTAssertTrue(aucklandOperations.timeDifference() == ", 16h ahead", "Difference was unexpectedly: \(aucklandOperations.timeDifference())") - XCTAssertTrue(omahaOperations.timeDifference() == ", an hour behind", "Difference was unexpectedly: \(omahaOperations.timeDifference())") + XCTAssertTrue(operations.timeDifference() == ", 10h 30m ahead", "Difference was unexpectedly: \(operations.timeDifference())") + XCTAssertTrue(californiaOperations.timeDifference() == ", 2h behind", "Difference was unexpectedly: \(californiaOperations.timeDifference())") + XCTAssertTrue(floridaOperations.timeDifference() == ", an hour ahead", "Difference was unexpectedly: \(floridaOperations.timeDifference())") + XCTAssertTrue(aucklandOperations.timeDifference() == ", 17h ahead", "Difference was unexpectedly: \(aucklandOperations.timeDifference())") + XCTAssertTrue(omahaOperations.timeDifference() == "", "Difference was unexpectedly: \(omahaOperations.timeDifference())") } func testSunriseSunset() { diff --git a/Clocker/Overall App/Themer.swift b/Clocker/Overall App/Themer.swift index 688cd549..cf145405 100644 --- a/Clocker/Overall App/Themer.swift +++ b/Clocker/Overall App/Themer.swift @@ -516,7 +516,11 @@ extension Themer { } func resetModernSliderImage() -> NSImage? { - return symbolImage(for: "xmark.circle.fill") + if let xmarkImage = symbolImage(for: "xmark.circle.fill") { + return xmarkImage + } + + return removeImage() } private func symbolImage(for name: String) -> NSImage? { diff --git a/Clocker/Panel/ParentPanelController+ModernSlider.swift b/Clocker/Panel/ParentPanelController+ModernSlider.swift index 2a569b39..90012b9b 100644 --- a/Clocker/Panel/ParentPanelController+ModernSlider.swift +++ b/Clocker/Panel/ParentPanelController+ModernSlider.swift @@ -18,8 +18,14 @@ extension ParentPanelController: NSCollectionViewDataSource { extension ParentPanelController { func setupModernSliderIfNeccessary() { if modernSlider != nil { - resetModernSliderButton.image = Themer.shared().resetModernSliderImage() - + if #available(OSX 11.0, *) { + resetModernSliderButton.image = Themer.shared().resetModernSliderImage() + } else { + resetModernSliderButton.layer?.backgroundColor = NSColor.lightGray.cgColor + resetModernSliderButton.layer?.masksToBounds = true + resetModernSliderButton.layer?.cornerRadius = resetModernSliderButton.frame.width / 2 + } + goBackwardsButton.image = Themer.shared().goBackwardsImage() goForwardButton.image = Themer.shared().goForwardsImage() @@ -29,6 +35,7 @@ extension ParentPanelController { goBackwardsButton.toolTip = "Navigate 15 mins back" goForwardButton.toolTip = "Navigate 15 mins forward" + modernSlider.wantsLayer = true // Required for animating reset to center modernSlider.enclosingScrollView?.scrollerInsets = NSEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) modernSlider.enclosingScrollView?.backgroundColor = NSColor.clear modernSlider.setAccessibility("ModernSlider")