This commit is contained in:
Alin
2024-06-12 13:38:36 -06:00
parent aee0dda76a
commit 8e12af932a
4 changed files with 43 additions and 8 deletions
+4 -2
View File
@@ -166,12 +166,14 @@ struct InfoButton: View {
let color: Color let color: Color
let label: String let label: String
let warning: Bool 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.text = text
self.color = color self.color = color
self.label = label self.label = label
self.warning = warning self.warning = warning
self.edge = edge
} }
@@ -202,7 +204,7 @@ struct InfoButton: View {
NSCursor.pop() NSCursor.pop()
} }
} }
.popover(isPresented: $isPopoverPresented, arrowEdge: .bottom) { .popover(isPresented: $isPopoverPresented, arrowEdge: edge) {
VStack { VStack {
Spacer() Spacer()
Text(text) Text(text)
+1 -1
View File
@@ -79,7 +79,7 @@ struct AppSearchView: View {
selectedSortAlpha.toggle() 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 { if mini && !menubarEnabled {
Button("") { Button("") {
+35 -3
View File
@@ -18,6 +18,8 @@ struct FilesView: View {
@AppStorage("settings.menubar.enabled") private var menubarEnabled: Bool = false @AppStorage("settings.menubar.enabled") private var menubarEnabled: Bool = false
@AppStorage("settings.general.selectedSort") var selectedSortAlpha: Bool = true @AppStorage("settings.general.selectedSort") var selectedSortAlpha: Bool = true
@AppStorage("settings.general.sizeType") var sizeType: String = "Real" @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 @Environment(\.colorScheme) var colorScheme
@Binding var showPopover: Bool @Binding var showPopover: Bool
@Binding var search: String @Binding var search: String
@@ -121,9 +123,10 @@ struct FilesView: View {
Text("\(appState.appInfo.appName)").font(.title).fontWeight(.bold).lineLimit(1) Text("\(appState.appInfo.appName)").font(.title).fontWeight(.bold).lineLimit(1)
Text("").foregroundStyle(Color("AccentColor")) Text("").foregroundStyle(Color("AccentColor"))
Text("v\(appState.appInfo.appVersion)").font(.title3) 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)") Text("\(appState.appInfo.bundleIdentifier)")
@@ -270,6 +273,10 @@ struct FilesView: View {
Spacer() 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)") { Button("\(sizeType == "Logical" ? totalSelectedSize.logical : sizeType == "Finder" ? totalSelectedSize.finder : totalSelectedSize.real)") {
Task { 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
}
}
} }
} }
+3 -2
View File
@@ -113,9 +113,7 @@ struct ZombieView: View {
VStack(alignment: .leading, spacing: 10){ VStack(alignment: .leading, spacing: 10){
HStack { HStack {
Text("Leftover Files").font(.title).fontWeight(.bold) 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() Spacer()
} }
Text("Remaining files and folders from previous applications") Text("Remaining files and folders from previous applications")
.font(.callout).foregroundStyle(Color("mode").opacity(0.5)) .font(.callout).foregroundStyle(Color("mode").opacity(0.5))
@@ -221,6 +219,8 @@ struct ZombieView: View {
Spacer() 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") { Button("Rescan") {
updateOnMain { updateOnMain {
appState.zombieFile = .empty appState.zombieFile = .empty
@@ -293,6 +293,7 @@ struct ZombieView: View {
VStack(spacing: 10) { VStack(spacing: 10) {
Text("Important") Text("Important")
.font(.headline) .font(.headline)
Divider()
Spacer() 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.") 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) .font(.subheadline)