Skip to content

Commit

Permalink
Merge pull request macadmins#323 from macadmins/differentiateWithoutC…
Browse files Browse the repository at this point in the history
…olor

differentiateWithoutColor for .red color scheme
  • Loading branch information
erikng authored Feb 24, 2022
2 parents bb5c752 + a0ec446 commit ed3afa1
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Nudge/UI/Common/DeferView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct DeferView: View {
@ObservedObject var viewObserved: ViewState
@Environment(\.presentationMode) var presentationMode
@Environment(\.colorScheme) var colorScheme
@Environment(\.accessibilityDifferentiateWithoutColor) var differentiateWithoutColor

@State var nudgeCustomEventDate = Date()

Expand All @@ -26,7 +27,7 @@ struct DeferView: View {
Image(systemName: "xmark.circle")
.resizable()
.frame(width: 20, height: 20)
.foregroundColor(.red)
.foregroundColor(differentiateWithoutColor ? Color(red: 230 / 255, green: 97 / 255, blue: 0 / 255) : .red)
}
.keyboardShortcut(.escape)
.buttonStyle(.plain)
Expand Down
3 changes: 2 additions & 1 deletion Nudge/UI/Common/DeviceInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import SwiftUI
// Sheet view for Device Information
struct DeviceInfo: View {
@Environment(\.presentationMode) var presentationMode
@Environment(\.accessibilityDifferentiateWithoutColor) var differentiateWithoutColor

// State variables
@State var systemConsoleUsername = Utils().getSystemConsoleUsername()
Expand All @@ -28,7 +29,7 @@ struct DeviceInfo: View {
Image(systemName: "xmark.circle")
.resizable()
.frame(width: 20, height: 20)
.foregroundColor(.red)
.foregroundColor(differentiateWithoutColor ? Color(red: 230 / 255, green: 97 / 255, blue: 0 / 255) : .red)
}
.buttonStyle(.plain)
.help("Click to close".localized(desiredLanguage: getDesiredLanguage()))
Expand Down
5 changes: 3 additions & 2 deletions Nudge/UI/SimpleMode/SimpleMode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ struct SimpleMode: View {
// Get the color scheme so we can dynamically change properties
@Environment(\.colorScheme) var colorScheme
@Environment(\.openURL) var openURL
@Environment(\.accessibilityDifferentiateWithoutColor) var differentiateWithoutColor

let bottomPadding: CGFloat = 10
let contentWidthPadding: CGFloat = 25
Expand Down Expand Up @@ -50,12 +51,12 @@ struct SimpleMode: View {
} else if viewObserved.daysRemaining == 0 && !Utils().demoModeEnabled() {
Text("Hours Remaining To Update:".localized(desiredLanguage: getDesiredLanguage()))
Text(String(viewObserved.hoursRemaining))
.foregroundColor(.red)
.foregroundColor(differentiateWithoutColor ? Color(red: 230 / 255, green: 97 / 255, blue: 0 / 255) : .red)
.fontWeight(.bold)
} else {
Text("Days Remaining To Update:".localized(desiredLanguage: getDesiredLanguage()))
Text(String(viewObserved.daysRemaining))
.foregroundColor(.red)
.foregroundColor(differentiateWithoutColor ? Color(red: 230 / 255, green: 97 / 255, blue: 0 / 255) : .red)
.fontWeight(.bold)

}
Expand Down
5 changes: 3 additions & 2 deletions Nudge/UI/StandardMode/LeftSide.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct StandardModeLeftSide: View {
@ObservedObject var viewObserved: ViewState
// Get the color scheme so we can dynamically change properties
@Environment(\.colorScheme) var colorScheme
@Environment(\.accessibilityDifferentiateWithoutColor) var differentiateWithoutColor

let logoWidth: CGFloat = 200
let logoHeight: CGFloat = 150
Expand Down Expand Up @@ -71,13 +72,13 @@ struct StandardModeLeftSide: View {
Text("Hours Remaining To Update:".localized(desiredLanguage: getDesiredLanguage()))
Spacer()
Text(String(viewObserved.hoursRemaining))
.foregroundColor(.red)
.foregroundColor(differentiateWithoutColor ? Color(red: 230 / 255, green: 97 / 255, blue: 0 / 255) : .red)
.fontWeight(.bold)
} else {
Text("Days Remaining To Update:".localized(desiredLanguage: getDesiredLanguage()))
Spacer()
Text(String(viewObserved.daysRemaining))
.foregroundColor(.red)
.foregroundColor(differentiateWithoutColor ? Color(red: 230 / 255, green: 97 / 255, blue: 0 / 255) : .red)
.fontWeight(.bold)

}
Expand Down
3 changes: 2 additions & 1 deletion Nudge/UI/StandardMode/RightSide.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ struct StandardModeRightSide: View {
// Get the color scheme so we can dynamically change properties
@Environment(\.colorScheme) var colorScheme
@Environment(\.openURL) var openURL
@Environment(\.accessibilityDifferentiateWithoutColor) var differentiateWithoutColor

// Modal view for screenshot and deferral info
@State var showSSDetail = false
Expand Down Expand Up @@ -101,7 +102,7 @@ struct StandardModeRightSide: View {
Text(mainContentNote)
.font(.callout)
.fontWeight(.bold)
.foregroundColor(Color.red)
.foregroundColor(differentiateWithoutColor ? Color(red: 230 / 255, green: 97 / 255, blue: 0 / 255) : .red)
Spacer()
}

Expand Down
3 changes: 2 additions & 1 deletion Nudge/UI/StandardMode/ScreenShotZoom.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import SwiftUI
struct ScreenShotZoom: View {
@Environment(\.presentationMode) var presentationMode
@Environment(\.colorScheme) var colorScheme
@Environment(\.accessibilityDifferentiateWithoutColor) var differentiateWithoutColor

var body: some View {
let darkMode = colorScheme == .dark
Expand All @@ -25,7 +26,7 @@ struct ScreenShotZoom: View {
Image(systemName: "xmark.circle")
.resizable()
.frame(width: 20, height: 20)
.foregroundColor(.red)
.foregroundColor(differentiateWithoutColor ? Color(red: 230 / 255, green: 97 / 255, blue: 0 / 255) : .red)
}
.buttonStyle(.plain)
.help("Click to close".localized(desiredLanguage: getDesiredLanguage()))
Expand Down

0 comments on commit ed3afa1

Please sign in to comment.