diff --git a/Padbury Clock Revived.xcodeproj/project.pbxproj b/Padbury Clock Revived.xcodeproj/project.pbxproj index e8db955..a3f8c53 100644 --- a/Padbury Clock Revived.xcodeproj/project.pbxproj +++ b/Padbury Clock Revived.xcodeproj/project.pbxproj @@ -104,7 +104,7 @@ 3AA5BF5125C98A31005B39FE /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1240; + LastUpgradeCheck = 1320; TargetAttributes = { 3AA5BF5925C98A31005B39FE = { CreatedOnToolsVersion = 12.4; @@ -265,6 +265,7 @@ MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; }; name = Release; }; diff --git a/Padbury Clock Revived.xcodeproj/project.xcworkspace/xcuserdata/hans.xcuserdatad/UserInterfaceState.xcuserstate b/Padbury Clock Revived.xcodeproj/project.xcworkspace/xcuserdata/hans.xcuserdatad/UserInterfaceState.xcuserstate index 419b9b5..34f0fb1 100644 Binary files a/Padbury Clock Revived.xcodeproj/project.xcworkspace/xcuserdata/hans.xcuserdatad/UserInterfaceState.xcuserstate and b/Padbury Clock Revived.xcodeproj/project.xcworkspace/xcuserdata/hans.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Padbury Clock Revived/ClockView.swift b/Padbury Clock Revived/ClockView.swift index 95a1914..b4dea4f 100644 --- a/Padbury Clock Revived/ClockView.swift +++ b/Padbury Clock Revived/ClockView.swift @@ -31,8 +31,8 @@ final class ClockView: ScreenSaverView { var fontSize: CGFloat = 0 var vOffset: CGFloat = 0 - var backgroundColor: NSColor = .red - var foregroundColor: NSColor = .red + var backgroundColor: NSColor = .blue + var foregroundColor: NSColor = .blue var dateFormatter: DateFormatter = DateFormatter() var attributes: [NSAttributedString.Key: Any] = [:] @@ -41,12 +41,15 @@ final class ClockView: ScreenSaverView { if force || !hasSetup { hasSetup = true + let currentHour = Calendar.current.component(.hour, from: Date()) + let useNightTimeMode = preferences.nightTimeMode && (currentHour >= (10 + 12) || currentHour < 6) + if preferences.darkTheme { backgroundColor = .black - foregroundColor = .white + foregroundColor = useNightTimeMode ? NSColor(red: 2.0 / 3.0, green: 0, blue: 0, alpha: 1) : .white } else { backgroundColor = .white - foregroundColor = .black + foregroundColor = useNightTimeMode ? .red : .black } let separator = preferences.showTimeSeparators ? ":" : " " diff --git a/Padbury Clock Revived/ConfigureSheet.xib b/Padbury Clock Revived/ConfigureSheet.xib index 305f4fb..7161cbd 100644 --- a/Padbury Clock Revived/ConfigureSheet.xib +++ b/Padbury Clock Revived/ConfigureSheet.xib @@ -1,7 +1,8 @@ - + - + + @@ -9,6 +10,7 @@ + @@ -22,19 +24,19 @@ - + - + - + - + @@ -43,7 +45,7 @@ - + @@ -52,16 +54,49 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -186,8 +221,8 @@ - - + +