From a0eb30f98ea5d04883904cda69db1060e0788daa Mon Sep 17 00:00:00 2001 From: Fabian Thies Date: Mon, 12 Dec 2022 19:20:54 +0100 Subject: [PATCH] [CHANGE] Fixed the AppRowView background blur effect --- AltStore/View Components/AppRowView.swift | 3 +- .../VisualEffectView.swift | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 AltStore/View Extensions/UIView Representables/VisualEffectView.swift diff --git a/AltStore/View Components/AppRowView.swift b/AltStore/View Components/AppRowView.swift index 2c2a9d73..9f2e5548 100644 --- a/AltStore/View Components/AppRowView.swift +++ b/AltStore/View Components/AppRowView.swift @@ -39,7 +39,8 @@ struct AppRowView: View { AppPillButton(app: app) } .padding() - .background(Color(storeApp?.tintColor ?? UIColor.black).opacity(0.5)) + .blurBackground(.systemUltraThinMaterialLight) + .background(Color(storeApp?.tintColor ?? UIColor.black).opacity(0.4)) .clipShape(RoundedRectangle(cornerRadius: 30, style: .circular)) } } diff --git a/AltStore/View Extensions/UIView Representables/VisualEffectView.swift b/AltStore/View Extensions/UIView Representables/VisualEffectView.swift new file mode 100644 index 00000000..4543749d --- /dev/null +++ b/AltStore/View Extensions/UIView Representables/VisualEffectView.swift @@ -0,0 +1,28 @@ +// +// VisualEffectView.swift +// SideStore +// +// Created by Fabian Thies on 01.12.22. +// Copyright © 2022 SideStore. All rights reserved. +// + +import SwiftUI + +struct VisualEffectView: UIViewRepresentable { + let blurStyle: UIBlurEffect.Style + + func makeUIView(context: Context) -> some UIView { + UIVisualEffectView(effect: UIBlurEffect(style: blurStyle)) + } + + func updateUIView(_ uiView: UIViewType, context: Context) { } +} + + +extension View { + @ViewBuilder + func blurBackground(_ style: UIBlurEffect.Style) -> some View { + self + .background(VisualEffectView(blurStyle: style)) + } +}