customize text color

This commit is contained in:
Trey t
2022-03-06 11:25:05 -06:00
parent 6ec0a9bb99
commit 7692f455c8
22 changed files with 225 additions and 92 deletions

View File

@@ -22,6 +22,7 @@ struct FilterView: View {
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
@AppStorage(UserDefaultsStore.Keys.moodTint.rawValue, store: GroupUserDefaults.groupDefaults) private var moodTint: MoodTints = .Default
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = .black
@StateObject private var viewModel = FilterViewModel()
//[
@@ -55,7 +56,7 @@ struct FilterView: View {
Text(String(localized: "filter_view_total") + ": \(self.viewModel.numberOfRatings)")
.font(.title2)
.foregroundColor(theme.currentTheme.labelColor)
.foregroundColor(textColor)
if showFilter {
filterView
@@ -82,7 +83,7 @@ struct FilterView: View {
Text(showFilter ? String(localized: "filter_view_hide_filters") : String(localized: "filter_view_show_filters"))
.frame(maxWidth: .infinity)
.frame(height: 44)
.foregroundColor(theme.currentTheme.labelColor)
.foregroundColor(textColor)
.background(theme.currentTheme.secondaryBGColor)
.cornerRadius(10)
}).frame(maxWidth: .infinity)
@@ -91,7 +92,8 @@ struct FilterView: View {
struct StatsSubView: View {
@AppStorage(UserDefaultsStore.Keys.moodTint.rawValue, store: GroupUserDefaults.groupDefaults) private var moodTint: MoodTints = .Default
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = .black
let data: [MoodEntry]
let mood: Mood
@@ -100,7 +102,7 @@ struct FilterView: View {
Text(String(Stats.getCountFor(moodType: mood,
inData: data)))
.font(.title)
.foregroundColor(theme.currentTheme.labelColor)
.foregroundColor(textColor)
Text(mood.strValue)
.foregroundColor(moodTint.color(forMood: mood))
}
@@ -139,8 +141,8 @@ struct FilterView: View {
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 44, maxHeight: 44)
.cornerRadius(10)
.padding([.leading, .trailing])
.foregroundColor(theme.currentTheme.labelColor)
.accentColor(theme.currentTheme.labelColor)
.foregroundColor(textColor)
.accentColor(textColor)
ZStack {
theme.currentTheme.secondaryBGColor
@@ -156,8 +158,8 @@ struct FilterView: View {
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 44, maxHeight: 44)
.cornerRadius(10)
.padding([.leading, .trailing])
.foregroundColor(theme.currentTheme.labelColor)
.accentColor(theme.currentTheme.labelColor)
.foregroundColor(textColor)
.accentColor(textColor)
ZStack {
theme.currentTheme.secondaryBGColor
@@ -196,7 +198,7 @@ struct FilterView: View {
ForEach(months, id: \.self.0) { item in
Text(item.1)
.textCase(.uppercase)
.foregroundColor(theme.currentTheme.labelColor)
.foregroundColor(textColor)
}
}.padding([.leading, .trailing, .top])
}
@@ -213,7 +215,7 @@ struct FilterView: View {
let yearData = self.viewModel.data[yearKey]!
Text(String(yearKey))
.font(.title)
.foregroundColor(theme.currentTheme.labelColor)
.foregroundColor(textColor)
yearGridView(yearData: yearData, columns: columns)
.background(
theme.currentTheme.secondaryBGColor