From b1d3704e9f5d9173b5c039f0af41610a868c5f64 Mon Sep 17 00:00:00 2001 From: Trey t Date: Sat, 26 Feb 2022 12:11:08 -0600 Subject: [PATCH] closed #93 --- .../views/CustomizeView/CustomizeView.swift | 78 +++++++++++++------ 1 file changed, 55 insertions(+), 23 deletions(-) diff --git a/Shared/views/CustomizeView/CustomizeView.swift b/Shared/views/CustomizeView/CustomizeView.swift index bfd8150..4781a0e 100644 --- a/Shared/views/CustomizeView/CustomizeView.swift +++ b/Shared/views/CustomizeView/CustomizeView.swift @@ -121,6 +121,13 @@ struct CustomizeView: View { Text(aTheme.title) } }) + .contentShape(Rectangle()) + .background( + RoundedRectangle(cornerRadius: 10, style: .continuous) + .fill(theme == aTheme ? theme.currentTheme.bgColor : .clear) + .padding(-5) + + ) Spacer() } } @@ -173,25 +180,36 @@ struct CustomizeView: View { theme.currentTheme.secondaryBGColor VStack { ForEach(MoodImages.allCases, id: \.rawValue) { images in - HStack { - ForEach(Mood.allValues, id: \.self) { mood in - images.icon(forMood: mood) - .resizable() - .aspectRatio(contentMode: .fit) - .frame(width: 35, height: 35) - .foregroundColor( - moodTint.color(forMood: mood) - ) + ZStack { + VStack { + HStack { + ForEach(Mood.allValues, id: \.self) { mood in + images.icon(forMood: mood) + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: 35, height: 35) + .foregroundColor( + moodTint.color(forMood: mood) + ) + } + .frame(minWidth: 0, maxWidth: .infinity) + } + .contentShape(Rectangle()) + .background( + RoundedRectangle(cornerRadius: 10, style: .continuous) + .fill(imagePack == images ? theme.currentTheme.bgColor : .clear) + .padding([.top, .bottom], -3) + + ) + .onTapGesture { + let impactMed = UIImpactFeedbackGenerator(style: .heavy) + impactMed.impactOccurred() + imagePack = images + } + if images.rawValue != (MoodImages.allCases.sorted(by: { $0.rawValue > $1.rawValue }).first?.rawValue) ?? 0 { + Divider() + } } - .frame(minWidth: 0, maxWidth: .infinity) - .onTapGesture { - let impactMed = UIImpactFeedbackGenerator(style: .heavy) - impactMed.impactOccurred() - imagePack = images - } - } - if images.rawValue != (MoodImages.allCases.sorted(by: { $0.rawValue > $1.rawValue }).first?.rawValue) ?? 0 { - Divider() } } } @@ -215,11 +233,18 @@ struct CustomizeView: View { ) } .frame(minWidth: 0, maxWidth: .infinity) - .onTapGesture { - let impactMed = UIImpactFeedbackGenerator(style: .heavy) - impactMed.impactOccurred() - moodTint = tint - } + } + .contentShape(Rectangle()) + .background( + RoundedRectangle(cornerRadius: 10, style: .continuous) + .fill(moodTint == tint ? theme.currentTheme.bgColor : .clear) + .padding([.top, .bottom], -3) + + ) + .onTapGesture { + let impactMed = UIImpactFeedbackGenerator(style: .heavy) + impactMed.impactOccurred() + moodTint = tint } if tint.rawValue != (MoodTints.allCases.sorted(by: { $0.rawValue > $1.rawValue }).first?.rawValue) ?? 0 { Divider() @@ -249,6 +274,13 @@ struct CustomizeView: View { } .frame(minWidth: 0, maxWidth: .infinity) .padding() + .contentShape(Rectangle()) + .background( + RoundedRectangle(cornerRadius: 10, style: .continuous) + .fill(personalityPack == aPack ? theme.currentTheme.bgColor : .clear) + .padding(5) + + ) .onTapGesture { let impactMed = UIImpactFeedbackGenerator(style: .heavy) impactMed.impactOccurred()