From c750646e8d7ad6c247082a89c0a51cf633b1a32f Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 3 Jul 2026 10:02:24 +0000 Subject: [PATCH] fix: use View-backed background for HomeStatsCard gradient Co-authored-by: Rocky --- .../Views/Components/HomeStatsCard.swift | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/OSGKeyboard/Views/Components/HomeStatsCard.swift b/OSGKeyboard/Views/Components/HomeStatsCard.swift index ad47312..b1be20c 100644 --- a/OSGKeyboard/Views/Components/HomeStatsCard.swift +++ b/OSGKeyboard/Views/Components/HomeStatsCard.swift @@ -57,7 +57,21 @@ struct HomeStatsCard: View { ) } } - .background(cardBackground, in: RoundedRectangle(cornerRadius: Radius.xl, style: .continuous)) + .background { + ZStack(alignment: .top) { + palette.surface + LinearGradient( + colors: [ + palette.accent.opacity(0.10), + palette.accent.opacity(0.02), + palette.surface.opacity(0) + ], + startPoint: .topLeading, + endPoint: .bottomTrailing + ) + } + } + .clipShape(RoundedRectangle(cornerRadius: Radius.xl, style: .continuous)) .overlay( RoundedRectangle(cornerRadius: Radius.xl, style: .continuous) .stroke(palette.divider, lineWidth: 0.5) @@ -68,21 +82,6 @@ struct HomeStatsCard: View { } } - private var cardBackground: some View { - ZStack(alignment: .top) { - palette.surface - LinearGradient( - colors: [ - palette.accent.opacity(0.10), - palette.accent.opacity(0.02), - palette.surface.opacity(0) - ], - startPoint: .topLeading, - endPoint: .bottomTrailing - ) - } - } - private func statCell(systemImage: String, value: String, label: LocalizedStringKey) -> some View { VStack(alignment: .leading, spacing: Spacing.xs) { HStack(spacing: 6) {