Skip to content

Commit

Permalink
Merge pull request #103 from zenangst/fix/colors-in-tutorial
Browse files Browse the repository at this point in the history
Refactor tutorial to fix colors in dark mode
  • Loading branch information
zenangst authored Sep 8, 2019
2 parents fd9cf4c + c70488d commit d7ab8b0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
19 changes: 12 additions & 7 deletions Sources/Features/First Launch/PermissionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ class PermissionViewController: ViewController {
lazy var gridView = NSGridView()
lazy var doneButton = NSButton(title: "All done!", target: self,
action: #selector(doneButton(_:)))
lazy var permissionsButton = NSButton(title: "System preferences", target: self,
action: #selector(grantPermission(_:)))
lazy var permissionsButton = Button(title: "System preferences",
backgroundColor: NSColor.systemGreen,
borderColor: NSColor.clear,
borderWidth: 0,
cornerRadius: .custom(4),
target: self,
action: #selector(grantPermission(_:)))

let factory = AnimationFactory()

Expand Down Expand Up @@ -111,6 +116,7 @@ class PermissionViewController: ViewController {
titleLabel.maximumNumberOfLines = 2
titleLabel.lineBreakMode = .byWordWrapping
titleLabel.alignment = .center
titleLabel.textColor = .black
titleLabel.wantsLayer = true

doneButton.wantsLayer = true
Expand All @@ -132,6 +138,7 @@ To sync and backup applications like Home, Contacts, Mail, News, Safari and Stoc
This step is optional but know that you cannot sync the applications mentioned above without granting access.
""")
syncLabel.textColor = .black
syncLabel.maximumNumberOfLines = -1
syncLabel.lineBreakMode = .byWordWrapping
syncIcon.image = NSImage.init(named: "Cloud")
Expand All @@ -142,15 +149,14 @@ This step is optional but know that you cannot sync the applications mentioned a
let backupIcon = NSImageView()
// swiftlint:disable line_length
let backupLabel = Label.init(labelWithString: "You can grant Syncalicious access by adding it to the list of applications that have Full Disk Access under Security & Privacy in System Preferences, located underr the privacy tab.")
backupLabel.textColor = .black
backupLabel.maximumNumberOfLines = -1
backupLabel.lineBreakMode = .byWordWrapping
backupIcon.image = NSImage.init(named: "Unlock")
backupIcon.contentTintColor = NSColor.init(named: "Yellow")
let backupRow = gridView.addRow(with: [backupIcon, backupLabel])
backupRow.yPlacement = .top

permissionsButton.wantsLayer = true

view.addSubview(gridView)
view.addSubview(titleLabel)
view.addSubview(iconView)
Expand All @@ -172,9 +178,8 @@ This step is optional but know that you cannot sync the applications mentioned a
gridView.leadingAnchor.constraint(equalTo: titleLabel.leadingAnchor),
gridView.trailingAnchor.constraint(equalTo: titleLabel.trailingAnchor),

permissionsButton.heightAnchor.constraint(equalToConstant: 56),
permissionsButton.topAnchor.constraint(equalTo: gridView.bottomAnchor),
permissionsButton.leadingAnchor.constraint(equalTo: gridView.leadingAnchor, constant: 48),
permissionsButton.topAnchor.constraint(equalTo: gridView.bottomAnchor, constant: 10),
permissionsButton.leadingAnchor.constraint(equalTo: backupLabel.leadingAnchor),

syncIcon.heightAnchor.constraint(equalToConstant: 48),
syncIcon.widthAnchor.constraint(equalToConstant: 48),
Expand Down
2 changes: 2 additions & 0 deletions Sources/Features/First Launch/WelcomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ class WelcomeViewController: ViewController {

let syncIcon = NSImageView()
let syncLabel = Label.init(labelWithString: "Sync application preferences across all your macs")
syncLabel.textColor = NSColor.black
syncLabel.maximumNumberOfLines = 2
syncLabel.lineBreakMode = .byWordWrapping
syncIcon.image = NSImage.init(named: "Synced")
Expand All @@ -166,6 +167,7 @@ class WelcomeViewController: ViewController {
let backupIcon = NSImageView()
let backupLabel = Label.init(labelWithString: "Backup your preferences files in case something goes wrong")
backupLabel.maximumNumberOfLines = 2
backupLabel.textColor = NSColor.black
backupLabel.lineBreakMode = .byWordWrapping
backupIcon.contentTintColor = NSColor.init(named: "Blue")
backupIcon.image = NSImage.init(named: "Backup")
Expand Down
4 changes: 2 additions & 2 deletions Syncalicious.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 0.0.3;
MARKETING_VERSION = 0.0.4;
PRODUCT_BUNDLE_IDENTIFIER = com.zenangst.Syncalicious;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -1029,7 +1029,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 0.0.3;
MARKETING_VERSION = 0.0.4;
PRODUCT_BUNDLE_IDENTIFIER = com.zenangst.Syncalicious;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down

0 comments on commit d7ab8b0

Please sign in to comment.