diff --git a/Pearcleaner/Logic/Styles.swift b/Pearcleaner/Logic/Styles.swift index fa3c0f4..8faa37e 100644 --- a/Pearcleaner/Logic/Styles.swift +++ b/Pearcleaner/Logic/Styles.swift @@ -166,12 +166,14 @@ struct InfoButton: View { let color: Color let label: String let warning: Bool + let edge: Edge - init(text: String, color: Color = Color("mode"), label: String = "", warning: Bool = false) { + init(text: String, color: Color = Color("mode"), label: String = "", warning: Bool = false, edge: Edge = .bottom) { self.text = text self.color = color self.label = label self.warning = warning + self.edge = edge } @@ -202,7 +204,7 @@ struct InfoButton: View { NSCursor.pop() } } - .popover(isPresented: $isPopoverPresented, arrowEdge: .bottom) { + .popover(isPresented: $isPopoverPresented, arrowEdge: edge) { VStack { Spacer() Text(text) diff --git a/Pearcleaner/Views/AppSearchView.swift b/Pearcleaner/Views/AppSearchView.swift index c6eb954..15dcc87 100644 --- a/Pearcleaner/Views/AppSearchView.swift +++ b/Pearcleaner/Views/AppSearchView.swift @@ -79,7 +79,7 @@ struct AppSearchView: View { selectedSortAlpha.toggle() } } - .buttonStyle(SimpleButtonStyle(icon: "circle.fill", label: "App List Sorting", help: "Can also click on User/System headers to toggle this", size: 5)) + .buttonStyle(SimpleButtonStyle(icon: "circle.fill", label: "Sorting: \(selectedSortAlpha ? "ABC" : "123")", help: "Can also click on User/System headers to toggle this", size: 5)) if mini && !menubarEnabled { Button("") { diff --git a/Pearcleaner/Views/FilesView.swift b/Pearcleaner/Views/FilesView.swift index b453e4e..37a9f88 100644 --- a/Pearcleaner/Views/FilesView.swift +++ b/Pearcleaner/Views/FilesView.swift @@ -18,6 +18,8 @@ struct FilesView: View { @AppStorage("settings.menubar.enabled") private var menubarEnabled: Bool = false @AppStorage("settings.general.selectedSort") var selectedSortAlpha: Bool = true @AppStorage("settings.general.sizeType") var sizeType: String = "Real" + @AppStorage("settings.general.filesWarning") private var warning: Bool = false + @State private var showAlert = false @Environment(\.colorScheme) var colorScheme @Binding var showPopover: Bool @Binding var search: String @@ -121,9 +123,10 @@ struct FilesView: View { Text("\(appState.appInfo.appName)").font(.title).fontWeight(.bold).lineLimit(1) Text("•").foregroundStyle(Color("AccentColor")) Text("v\(appState.appInfo.appVersion)").font(.title3) - if appState.appInfo.appName.count < 5 { - InfoButton(text: "Pearcleaner searches for files via a combination of bundle id and app name. \(appState.appInfo.appName) has a common or short app name so there might be unrelated files found. Please check the list thoroughly before uninstalling.") - } + +// if appState.appInfo.appName.count < 5 { +// InfoButton(text: "Pearcleaner searches for files via a combination of bundle id and app name. \(appState.appInfo.appName) has a common or short app name so there might be unrelated files found. Please check the list thoroughly before uninstalling.") +// } } Text("\(appState.appInfo.bundleIdentifier)") @@ -270,6 +273,10 @@ struct FilesView: View { Spacer() + InfoButton(text: "Always double-check the files/folders marked for removal. In some rare cases, Pearcleaner may find some unrelated files when app names are too similar.", color: Color("mode").opacity(0.5), warning: true, edge: .top) + .padding(.top) + + Button("\(sizeType == "Logical" ? totalSelectedSize.logical : sizeType == "Finder" ? totalSelectedSize.finder : totalSelectedSize.real)") { Task { @@ -362,6 +369,31 @@ struct FilesView: View { } } + .sheet(isPresented: $showAlert, content: { + VStack(spacing: 10) { + Text("Important") + .font(.headline) + Divider() + Spacer() + Text("Always double-check the files/folders marked for removal. In some rare cases, Pearcleaner may find some unrelated files when app names are too similar.") + .font(.subheadline) + Spacer() + Button("Close") { + warning = true + showAlert = false + } + .buttonStyle(SimpleButtonStyle(icon: "x.circle.fill", label: "Close", help: "Dismiss")) + Spacer() + } + .padding(15) + .frame(width: 400, height: 200) + .background(GlassEffect(material: .hudWindow, blendingMode: .behindWindow)) + }) + .onAppear { + if !warning { + showAlert = true + } + } } } diff --git a/Pearcleaner/Views/ZombieView.swift b/Pearcleaner/Views/ZombieView.swift index 6b8c719..4f3a6a0 100644 --- a/Pearcleaner/Views/ZombieView.swift +++ b/Pearcleaner/Views/ZombieView.swift @@ -113,9 +113,7 @@ struct ZombieView: View { VStack(alignment: .leading, spacing: 10){ HStack { Text("Leftover Files").font(.title).fontWeight(.bold) - InfoButton(text: "Leftover file search is not 100% accurate as it doesn't have any uninstalled app bundles to check against for file exclusion. This does a best guess search for files/folders and excludes the ones that have overlap with your currently installed applications. Please confirm files marked for deletion really do belong to uninstalled applications.", color: .orange, warning: true) Spacer() - } Text("Remaining files and folders from previous applications") .font(.callout).foregroundStyle(Color("mode").opacity(0.5)) @@ -221,6 +219,8 @@ struct ZombieView: View { Spacer() + InfoButton(text: "Leftover file search is not 100% accurate as it doesn't have any uninstalled app bundles to check against for file exclusion. This does a best guess search for files/folders and excludes the ones that have overlap with your currently installed applications. Please confirm files marked for deletion really do belong to uninstalled applications.", color: .orange, warning: true, edge: .top) + Button("Rescan") { updateOnMain { appState.zombieFile = .empty @@ -293,6 +293,7 @@ struct ZombieView: View { VStack(spacing: 10) { Text("Important") .font(.headline) + Divider() Spacer() Text("Leftover file search is not 100% accurate as it doesn't have any uninstalled app bundles to check against for file exclusion. This does a best guess search for files/folders and excludes the ones that have overlap with your currently installed applications. Please confirm files marked for deletion really do belong to uninstalled applications.") .font(.subheadline)