From 78959961188adc86657cfebdbbd96da032956bc4 Mon Sep 17 00:00:00 2001 From: Alin Date: Sat, 2 Mar 2024 23:46:32 -0700 Subject: [PATCH] v3.0.1 --- Pearcleaner.xcodeproj/project.pbxproj | 8 ++-- Pearcleaner/Logic/Locations.swift | 1 + Pearcleaner/Logic/Styles.swift | 5 +- Pearcleaner/PearcleanerApp.swift | 3 +- .../AccentColor.colorset/Contents.json | 8 ++-- .../windowBG.colorset/Contents.json | 38 +++++++++++++++ Pearcleaner/Settings/General.swift | 1 + Pearcleaner/Views/AppListView.swift | 35 +++++++++----- Pearcleaner/Views/MiniMode.swift | 48 +++++++++++-------- 9 files changed, 106 insertions(+), 41 deletions(-) create mode 100644 Pearcleaner/Resources/Assets.xcassets/windowBG.colorset/Contents.json diff --git a/Pearcleaner.xcodeproj/project.pbxproj b/Pearcleaner.xcodeproj/project.pbxproj index 1f5edf4..f1be59c 100644 --- a/Pearcleaner.xcodeproj/project.pbxproj +++ b/Pearcleaner.xcodeproj/project.pbxproj @@ -539,7 +539,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 19; + CURRENT_PROJECT_VERSION = 20; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BK8443AXLU; @@ -557,7 +557,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 3.0.0; + MARKETING_VERSION = 3.0.1; PRODUCT_BUNDLE_IDENTIFIER = com.alienator88.Pearcleaner; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -574,7 +574,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 19; + CURRENT_PROJECT_VERSION = 20; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BK8443AXLU; @@ -592,7 +592,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 3.0.0; + MARKETING_VERSION = 3.0.1; PRODUCT_BUNDLE_IDENTIFIER = com.alienator88.Pearcleaner; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; diff --git a/Pearcleaner/Logic/Locations.swift b/Pearcleaner/Logic/Locations.swift index 9528191..5325f85 100644 --- a/Pearcleaner/Logic/Locations.swift +++ b/Pearcleaner/Logic/Locations.swift @@ -43,6 +43,7 @@ class Locations: ObservableObject { "\(home)/Library/Preferences", "\(home)/Library/Preferences/ByHost", "\(home)/Library/Saved Application State", + "\(home)/Library/Services", "\(home)/Library/WebKit", "/Users/Shared", "/Users/Library", diff --git a/Pearcleaner/Logic/Styles.swift b/Pearcleaner/Logic/Styles.swift index 042c759..ee19704 100644 --- a/Pearcleaner/Logic/Styles.swift +++ b/Pearcleaner/Logic/Styles.swift @@ -541,6 +541,7 @@ struct FilesViewActionButton: ButtonStyle { + struct SentinelToggleStyle: ToggleStyle { func makeBody(configuration: Configuration) -> some View { @@ -669,7 +670,7 @@ struct PearDropView: View { VStack(alignment: .center, spacing: 0) { HStack(spacing: 0) { LinearGradient(gradient: Gradient(colors: [.green, .orange]), startPoint: .leading, endPoint: .trailing) - .frame(width: 195) + .frame(width: 220) LinearGradient(gradient: Gradient(colors: [.orange, Color("mode").opacity(0.5)]), startPoint: .leading, endPoint: .trailing) .frame(width: 10) LinearGradient(gradient: Gradient(colors: [Color("mode").opacity(0.5), Color("mode").opacity(0.5)]), startPoint: .leading, endPoint: .trailing) @@ -679,7 +680,7 @@ struct PearDropView: View { Image("logo_text_small") .resizable() .scaledToFit() - .frame(width: 500, height: 120) + .frame(width: 500) .padding() ) diff --git a/Pearcleaner/PearcleanerApp.swift b/Pearcleaner/PearcleanerApp.swift index 5ec7664..a8420ef 100644 --- a/Pearcleaner/PearcleanerApp.swift +++ b/Pearcleaner/PearcleanerApp.swift @@ -102,7 +102,7 @@ struct PearcleanerApp: App { loadAllPaths(allApps: sortedApps.userApps + sortedApps.systemApps, appState: appState, locations: locations) } - getFeatures(appState: appState, show: $showFeature, features: $features) + #if !DEBUG Task { @@ -114,6 +114,7 @@ struct PearcleanerApp: App { // Check for updates after app launch if diskP { loadGithubReleases(appState: appState) + getFeatures(appState: appState, show: $showFeature, features: $features) } // Check for disk/accessibility permissions just once on initial app launch diff --git a/Pearcleaner/Resources/Assets.xcassets/AccentColor.colorset/Contents.json b/Pearcleaner/Resources/Assets.xcassets/AccentColor.colorset/Contents.json index 4f9ac77..92ef031 100644 --- a/Pearcleaner/Resources/Assets.xcassets/AccentColor.colorset/Contents.json +++ b/Pearcleaner/Resources/Assets.xcassets/AccentColor.colorset/Contents.json @@ -5,8 +5,8 @@ "color-space" : "display-p3", "components" : { "alpha" : "1.000", - "blue" : "0x59", - "green" : "0x48", + "blue" : "0xFF", + "green" : "0xFF", "red" : "0xFF" } }, @@ -23,8 +23,8 @@ "color-space" : "display-p3", "components" : { "alpha" : "1.000", - "blue" : "0x59", - "green" : "0x48", + "blue" : "0xFF", + "green" : "0xFF", "red" : "0xFF" } }, diff --git a/Pearcleaner/Resources/Assets.xcassets/windowBG.colorset/Contents.json b/Pearcleaner/Resources/Assets.xcassets/windowBG.colorset/Contents.json new file mode 100644 index 0000000..fdcb29e --- /dev/null +++ b/Pearcleaner/Resources/Assets.xcassets/windowBG.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0xF6", + "green" : "0xF6", + "red" : "0xF6" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0x29", + "green" : "0x28", + "red" : "0x29" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Pearcleaner/Settings/General.swift b/Pearcleaner/Settings/General.swift index 526e041..d87e744 100644 --- a/Pearcleaner/Settings/General.swift +++ b/Pearcleaner/Settings/General.swift @@ -48,6 +48,7 @@ struct GeneralSettingsTab: View { .font(.callout) .foregroundStyle(.gray) } + InfoButton(text: "When transparent material is enabled, sticky section headers (User/System) in app list are disabled to keep from showing app name text overlayed under the section header text with no background to separate the two.", color: nil) Spacer() Toggle(isOn: $glass, label: { }) diff --git a/Pearcleaner/Views/AppListView.swift b/Pearcleaner/Views/AppListView.swift index 45b7c3c..31d5cc2 100644 --- a/Pearcleaner/Views/AppListView.swift +++ b/Pearcleaner/Views/AppListView.swift @@ -64,35 +64,46 @@ struct AppListView: View { } } .padding(.top, 20) - .padding(.bottom) +// .padding(.bottom) ScrollView { - LazyVStack(alignment: .leading, pinnedViews: [.sectionHeaders]) { + LazyVStack(alignment: .leading, spacing: 0, pinnedViews: [glass ? [] : .sectionHeaders]) { if filteredUserApps.count > 0 { - VStack { - Header(title: "User", count: filteredUserApps.count, showPopover: $showPopover) +// VStack { +// Header(title: "User", count: filteredUserApps.count, showPopover: $showPopover) ForEach(filteredUserApps, id: \.self) { appInfo in - AppListItems(search: $search, showPopover: $showPopover, appInfo: appInfo) - if appInfo != filteredUserApps.last { - Divider().padding(.horizontal, 5) + Section(header: Header(title: "User", count: filteredUserApps.count, showPopover: $showPopover)) { + AppListItems(search: $search, showPopover: $showPopover, appInfo: appInfo) + .padding(.vertical,5) + if appInfo != filteredUserApps.last { + Divider().padding(.horizontal, 5) + } } +// AppListItems(search: $search, showPopover: $showPopover, appInfo: appInfo) +// if appInfo != filteredUserApps.last { +// Divider().padding(.horizontal, 5) +// } } - } +// } } if filteredSystemApps.count > 0 { - VStack { - Header(title: "System", count: filteredSystemApps.count, showPopover: $showPopover) +// VStack { +// Header(title: "System", count: filteredSystemApps.count, showPopover: $showPopover) + Section(header: Header(title: "System", count: filteredSystemApps.count, showPopover: $showPopover)) { + ForEach(filteredSystemApps, id: \.self) { appInfo in AppListItems(search: $search, showPopover: $showPopover, appInfo: appInfo) + .padding(.vertical,5) if appInfo != filteredSystemApps.last { Divider().padding(.horizontal, 5) } } } +// } } } @@ -199,6 +210,7 @@ struct Header: View { @EnvironmentObject var locations: Locations @Binding var showPopover: Bool @AppStorage("settings.general.instant") private var instantSearch: Bool = true + @AppStorage("settings.general.glass") private var glass: Bool = true var body: some View { @@ -253,7 +265,8 @@ struct Header: View { Spacer() } - .padding(.vertical, 8) + .padding(.vertical, 9) .padding(.leading, 6) + .background(!glass ? Color("windowBG") : .clear) } } diff --git a/Pearcleaner/Views/MiniMode.swift b/Pearcleaner/Views/MiniMode.swift index 0f16125..a1643a6 100644 --- a/Pearcleaner/Views/MiniMode.swift +++ b/Pearcleaner/Views/MiniMode.swift @@ -91,9 +91,11 @@ struct MiniEmptyView: View { Image(systemName: "plus.square.dashed") .resizable() .scaledToFit() - .frame(width: 100, height: 100) + .frame(width: 120, height: 120) .padding() + .fontWeight(.ultraLight) ) + .frame(width: 160) } Text("Drop your app here") @@ -142,6 +144,7 @@ struct MiniAppView: View { @State private var showUsr: Bool = true @AppStorage("settings.general.mini") private var mini: Bool = false @AppStorage("settings.general.instant") private var instantSearch: Bool = true + @AppStorage("settings.general.glass") private var glass: Bool = true @Binding var showPopover: Bool var body: some View { @@ -185,43 +188,50 @@ struct MiniAppView: View { ScrollView { - LazyVStack(alignment: .leading, pinnedViews: [.sectionHeaders]) { + LazyVStack(alignment: .leading, spacing: 0, pinnedViews: [glass ? [] : .sectionHeaders]) { if filteredUserApps.count > 0 { - VStack { - Header(title: "User", count: filteredUserApps.count, showPopover: $showPopover) - ForEach(filteredUserApps, id: \.self) { appInfo in - AppListItems(search: $search, showPopover: $showPopover, appInfo: appInfo) - if appInfo != filteredUserApps.last { - Divider().padding(.horizontal, 5) +// VStack { +// Header(title: "User", count: filteredUserApps.count, showPopover: $showPopover) + Section(header: Header(title: "User", count: filteredUserApps.count, showPopover: $showPopover)) { + + ForEach(filteredUserApps, id: \.self) { appInfo in + AppListItems(search: $search, showPopover: $showPopover, appInfo: appInfo) +// .padding(.vertical,5) + if appInfo != filteredUserApps.last { + Divider().padding(.horizontal, 5) + } } } - } +// } } if filteredSystemApps.count > 0 { - VStack { - Header(title: "System", count: filteredSystemApps.count, showPopover: $showPopover) - ForEach(filteredSystemApps, id: \.self) { appInfo in - AppListItems(search: $search, showPopover: $showPopover, appInfo: appInfo) - if appInfo != filteredSystemApps.last { - Divider().padding(.horizontal, 5) +// VStack { +// Header(title: "System", count: filteredSystemApps.count, showPopover: $showPopover) + Section(header: Header(title: "System", count: filteredSystemApps.count, showPopover: $showPopover)) { + ForEach(filteredSystemApps, id: \.self) { appInfo in + AppListItems(search: $search, showPopover: $showPopover, appInfo: appInfo) + .padding(.vertical,5) + if appInfo != filteredSystemApps.last { + Divider().padding(.horizontal, 5) + } } } - } +// } } - + } .padding(.horizontal) - + } .scrollIndicators(.never) if appState.currentView != .empty { - SearchBarMiniBottom(search: $search) + SearchBarMiniBottom(search: $search).background(.ultraThinMaterial) } } .padding(.bottom)