customize text color
This commit is contained in:
@@ -18,6 +18,10 @@ struct CustomizeView: View {
|
||||
|
||||
@AppStorage(UserDefaultsStore.Keys.customMoodTintUpdateNumber.rawValue, store: GroupUserDefaults.groupDefaults) private var customMoodTintUpdateNumber: Int = 0
|
||||
|
||||
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = .black
|
||||
|
||||
@State private var sampleListEntry = PersistenceController.shared.randomEntries(count: 1).first!
|
||||
|
||||
@StateObject private var customMoodTint = UserDefaultsStore.getCustomMoodTint()
|
||||
|
||||
class StupidAssCustomWidgetObservableObject: ObservableObject {
|
||||
@@ -43,8 +47,14 @@ struct CustomizeView: View {
|
||||
createCustomWidget
|
||||
changeIcon
|
||||
themePicker
|
||||
Divider()
|
||||
sampleEntryView
|
||||
pickMoodImagePack
|
||||
pickMoodTintPack
|
||||
Group {
|
||||
pickMoodTintPack
|
||||
pickTextColor
|
||||
}
|
||||
Divider()
|
||||
pickPeronsalityPack
|
||||
}
|
||||
}
|
||||
@@ -316,6 +326,48 @@ struct CustomizeView: View {
|
||||
.cornerRadius(10, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
|
||||
}
|
||||
|
||||
private var pickTextColor: some View {
|
||||
ZStack {
|
||||
theme.currentTheme.secondaryBGColor
|
||||
ColorPicker(String(localized: "customize_view_view_text_color"), selection: $textColor)
|
||||
.padding()
|
||||
.foregroundColor(textColor)
|
||||
}
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.cornerRadius(10, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
|
||||
}
|
||||
|
||||
private var sampleEntryView: some View {
|
||||
ZStack {
|
||||
theme.currentTheme.secondaryBGColor
|
||||
|
||||
VStack {
|
||||
HStack {
|
||||
Spacer()
|
||||
Image(systemName: "arrow.triangle.2.circlepath.circle")
|
||||
.resizable()
|
||||
.frame(width: 20, height: 20, alignment: .trailing)
|
||||
.foregroundColor(Color(UIColor.systemGray))
|
||||
.onTapGesture {
|
||||
sampleListEntry = PersistenceController.shared.randomEntries(count: 1).first!
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
}.padding()
|
||||
|
||||
VStack(alignment:.leading) {
|
||||
Text(String(localized: "customize_view_view_example_row"))
|
||||
.padding([.leading, .top])
|
||||
.foregroundColor(textColor)
|
||||
Divider()
|
||||
EntryListView(entry: sampleListEntry)
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.cornerRadius(10, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
|
||||
}
|
||||
|
||||
private func saveCustomMoodTint() {
|
||||
UserDefaultsStore.saveCustomMoodTint(customTint: customMoodTint)
|
||||
moodTint = .Custom
|
||||
@@ -330,7 +382,7 @@ struct CustomizeView: View {
|
||||
VStack(spacing: 10) {
|
||||
Text(String(aPack.title()))
|
||||
.font(.body)
|
||||
.foregroundColor(theme.currentTheme.labelColor)
|
||||
.foregroundColor(textColor)
|
||||
|
||||
Text(aPack.randomPushNotificationStrings().title)
|
||||
.font(.body)
|
||||
@@ -364,3 +416,14 @@ struct CustomizeView: View {
|
||||
.cornerRadius(10, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
|
||||
}
|
||||
}
|
||||
|
||||
struct CustomizeView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
Group {
|
||||
CustomizeView()
|
||||
|
||||
CustomizeView()
|
||||
.preferredColorScheme(.dark)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user