diff options
| author | Dustin Mierau <dustin@mierau.me> | 2025-11-07 12:44:55 -0800 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2025-11-07 12:44:55 -0800 |
| commit | a55318fa8d643160900bec3e6b14e7404c63497a (patch) | |
| tree | ab6a9eca9a368b35e1490becc70f94ebde6ac271 /Hotline/Library/Views/GroupedIconView.swift | |
| parent | 786a387d58fc66ae20716a9dee46b74dff8e6894 (diff) | |
Organize Library folder a bit. Update Tracker add/edit sheet design.
Diffstat (limited to 'Hotline/Library/Views/GroupedIconView.swift')
| -rw-r--r-- | Hotline/Library/Views/GroupedIconView.swift | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Hotline/Library/Views/GroupedIconView.swift b/Hotline/Library/Views/GroupedIconView.swift new file mode 100644 index 0000000..313fac6 --- /dev/null +++ b/Hotline/Library/Views/GroupedIconView.swift @@ -0,0 +1,23 @@ +import SwiftUI + +struct GroupedIconView: View { + let color: Color + let systemName: String + var padding: CGFloat = 6.0 + var cornerRadius: CGFloat = 8.0 + + var body: some View { + RoundedRectangle(cornerRadius: self.cornerRadius, style: .continuous) + .fill(LinearGradient(colors: [self.color.mix(with: .white, by: 0.2), self.color], startPoint: .top, endPoint: .bottom)) + .shadow(color: self.color.mix(with: .black, by: 0.5).opacity(0.2), radius: 1, x: 0, y: 1) + .overlay { + Image(systemName: self.systemName) + .resizable() + .scaledToFit() + .symbolRenderingMode(.palette) + .foregroundStyle(.white, .white.opacity(0.4)) + .padding(self.padding) + .shadow(color: self.color.mix(with: .black, by: 0.5).opacity(0.2), radius: 0, x: 0, y: -1) + } + } +} |