iOS 2.4.0 - Colour accents and theming
This commit is contained in:
@@ -5,6 +5,7 @@ struct AddAttemptView: View {
|
||||
let session: ClimbSession
|
||||
let gym: Gym
|
||||
@EnvironmentObject var dataManager: ClimbingDataManager
|
||||
@EnvironmentObject var themeManager: ThemeManager
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
@State private var selectedProblem: Problem?
|
||||
@@ -158,6 +159,7 @@ struct AddAttemptView: View {
|
||||
showingCreateProblem = true
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
.tint(themeManager.accentColor)
|
||||
}
|
||||
.padding(.vertical, 8)
|
||||
} else {
|
||||
@@ -179,7 +181,7 @@ struct AddAttemptView: View {
|
||||
Button("Create New Problem") {
|
||||
showingCreateProblem = true
|
||||
}
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -198,7 +200,7 @@ struct AddAttemptView: View {
|
||||
selectedPhotos = []
|
||||
imageData = []
|
||||
}
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +215,7 @@ struct AddAttemptView: View {
|
||||
Spacer()
|
||||
if selectedClimbType == climbType {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
} else {
|
||||
Image(systemName: "circle")
|
||||
.foregroundColor(.gray)
|
||||
@@ -238,7 +240,7 @@ struct AddAttemptView: View {
|
||||
Spacer()
|
||||
if selectedDifficultySystem == system {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
} else {
|
||||
Image(systemName: "circle")
|
||||
.foregroundColor(.gray)
|
||||
@@ -272,7 +274,7 @@ struct AddAttemptView: View {
|
||||
}
|
||||
.buttonStyle(.bordered)
|
||||
.controlSize(.small)
|
||||
.tint(newProblemGrade == grade ? .blue : .gray)
|
||||
.tint(newProblemGrade == grade ? themeManager.accentColor : .gray)
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 1)
|
||||
@@ -287,12 +289,12 @@ struct AddAttemptView: View {
|
||||
}) {
|
||||
HStack {
|
||||
Image(systemName: "camera.fill")
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
.font(.title2)
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Text("Add Photos")
|
||||
.font(.headline)
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
Text("\(imageData.count) of 5 photos added")
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
@@ -353,7 +355,7 @@ struct AddAttemptView: View {
|
||||
Spacer()
|
||||
if selectedResult == result {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
} else {
|
||||
Image(systemName: "circle")
|
||||
.foregroundColor(.gray)
|
||||
@@ -529,6 +531,7 @@ struct ProblemSelectionRow: View {
|
||||
let problem: Problem
|
||||
let isSelected: Bool
|
||||
let action: () -> Void
|
||||
@EnvironmentObject var themeManager: ThemeManager
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
@@ -539,7 +542,7 @@ struct ProblemSelectionRow: View {
|
||||
|
||||
Text("\(problem.difficulty.system.displayName): \(problem.difficulty.grade)")
|
||||
.font(.subheadline)
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
|
||||
if let location = problem.location {
|
||||
Text(location)
|
||||
@@ -552,7 +555,7 @@ struct ProblemSelectionRow: View {
|
||||
|
||||
if isSelected {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
} else {
|
||||
Image(systemName: "circle")
|
||||
.foregroundColor(.gray)
|
||||
@@ -569,6 +572,7 @@ struct ProblemSelectionCard: View {
|
||||
let isSelected: Bool
|
||||
let action: () -> Void
|
||||
@State private var showingExpandedView = false
|
||||
@EnvironmentObject var themeManager: ThemeManager
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 8) {
|
||||
@@ -594,7 +598,7 @@ struct ProblemSelectionCard: View {
|
||||
if isSelected {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.foregroundColor(.white)
|
||||
.background(Circle().fill(.blue))
|
||||
.background(Circle().fill(themeManager.accentColor))
|
||||
.font(.title3)
|
||||
}
|
||||
}
|
||||
@@ -634,7 +638,7 @@ struct ProblemSelectionCard: View {
|
||||
Text(problem.difficulty.grade)
|
||||
.font(.caption2)
|
||||
.fontWeight(.bold)
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
|
||||
if let location = problem.location {
|
||||
Text(location)
|
||||
@@ -648,8 +652,8 @@ struct ProblemSelectionCard: View {
|
||||
.padding(8)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 12)
|
||||
.fill(isSelected ? .blue.opacity(0.1) : .gray.opacity(0.05))
|
||||
.stroke(isSelected ? .blue : .clear, lineWidth: 2)
|
||||
.fill(isSelected ? themeManager.accentColor.opacity(0.1) : .gray.opacity(0.05))
|
||||
.stroke(isSelected ? themeManager.accentColor : .clear, lineWidth: 2)
|
||||
)
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
@@ -668,6 +672,7 @@ struct ProblemSelectionCard: View {
|
||||
struct ProblemExpandedView: View {
|
||||
let problem: Problem
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
@EnvironmentObject var themeManager: ThemeManager
|
||||
@State private var selectedImageIndex = 0
|
||||
|
||||
var body: some View {
|
||||
@@ -696,7 +701,7 @@ struct ProblemExpandedView: View {
|
||||
Text(problem.difficulty.grade)
|
||||
.font(.title3)
|
||||
.fontWeight(.bold)
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
|
||||
Text(problem.climbType.displayName)
|
||||
.font(.subheadline)
|
||||
@@ -724,9 +729,9 @@ struct ProblemExpandedView: View {
|
||||
.padding(.vertical, 4)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 8)
|
||||
.fill(.blue.opacity(0.1))
|
||||
.fill(themeManager.accentColor.opacity(0.1))
|
||||
)
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
}
|
||||
}
|
||||
.padding(.horizontal)
|
||||
@@ -752,6 +757,7 @@ struct ProblemExpandedView: View {
|
||||
struct EditAttemptView: View {
|
||||
let attempt: Attempt
|
||||
@EnvironmentObject var dataManager: ClimbingDataManager
|
||||
@EnvironmentObject var themeManager: ThemeManager
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
@State private var selectedProblem: Problem?
|
||||
@@ -926,6 +932,7 @@ struct EditAttemptView: View {
|
||||
showingCreateProblem = true
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
.tint(themeManager.accentColor)
|
||||
}
|
||||
.padding(.vertical, 8)
|
||||
} else {
|
||||
@@ -947,7 +954,7 @@ struct EditAttemptView: View {
|
||||
Button("Create New Problem") {
|
||||
showingCreateProblem = true
|
||||
}
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -966,7 +973,7 @@ struct EditAttemptView: View {
|
||||
selectedPhotos = []
|
||||
imageData = []
|
||||
}
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -981,7 +988,7 @@ struct EditAttemptView: View {
|
||||
Spacer()
|
||||
if selectedClimbType == climbType {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
} else {
|
||||
Image(systemName: "circle")
|
||||
.foregroundColor(.gray)
|
||||
@@ -1006,7 +1013,7 @@ struct EditAttemptView: View {
|
||||
Spacer()
|
||||
if selectedDifficultySystem == system {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
} else {
|
||||
Image(systemName: "circle")
|
||||
.foregroundColor(.gray)
|
||||
@@ -1040,7 +1047,7 @@ struct EditAttemptView: View {
|
||||
}
|
||||
.buttonStyle(.bordered)
|
||||
.controlSize(.small)
|
||||
.tint(newProblemGrade == grade ? .blue : .gray)
|
||||
.tint(newProblemGrade == grade ? themeManager.accentColor : .gray)
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 1)
|
||||
@@ -1055,12 +1062,12 @@ struct EditAttemptView: View {
|
||||
}) {
|
||||
HStack {
|
||||
Image(systemName: "camera.fill")
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
.font(.title2)
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Text("Add Photos")
|
||||
.font(.headline)
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
Text("\(imageData.count) of 5 photos added")
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
@@ -1121,7 +1128,7 @@ struct EditAttemptView: View {
|
||||
Spacer()
|
||||
if selectedResult == result {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.foregroundColor(.blue)
|
||||
.foregroundColor(themeManager.accentColor)
|
||||
} else {
|
||||
Image(systemName: "circle")
|
||||
.foregroundColor(.gray)
|
||||
|
||||
Reference in New Issue
Block a user