Skip to content

Commit

Permalink
Fixed #2
Browse files Browse the repository at this point in the history
  • Loading branch information
SKemenov committed Mar 16, 2024
1 parent c1cd2d0 commit b47a2e7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.xcscheme
10 changes: 10 additions & 0 deletions MinimalCountdown/MinimalCountdownView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ final class MinimalCountdownView: ScreenSaverView {

private extension MinimalCountdownView {
func configureScene() {
configureDefaults()
configureUI()
configureConstraints()
}
Expand All @@ -85,6 +86,15 @@ private extension MinimalCountdownView {
updateTargetDate()
}

func configureDefaults() {
if screenSaverDefaults.targetDate.timeIntervalSince1970 == 0.0 {
screenSaverDefaults.brightIsNormal = true
screenSaverDefaults.messageIsHidden = true
screenSaverDefaults.showElementsIndex = 3
screenSaverDefaults.targetDate = Date(timeIntervalSinceNow: 60 * 60 * 24 * 30)
}
}

func configureUI() {
Resources.backgroundColors[screenSaverDefaults.backgroundColorIndex].setFill()
NSBezierPath.fill(bounds)
Expand Down

0 comments on commit b47a2e7

Please sign in to comment.