From f62148d08ad74a7f24e1587aaa98b79fb4c497a2 Mon Sep 17 00:00:00 2001 From: Alin Date: Mon, 11 Mar 2024 12:27:57 -0600 Subject: [PATCH] Update view --- Pearcleaner/Logic/Styles.swift | 4 ++++ Pearcleaner/PearcleanerApp.swift | 2 +- Pearcleaner/Settings/SettingsWindow.swift | 3 ++- Pearcleaner/Settings/Update.swift | 18 +++++++++++++----- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Pearcleaner/Logic/Styles.swift b/Pearcleaner/Logic/Styles.swift index 020ceca..d007b4f 100644 --- a/Pearcleaner/Logic/Styles.swift +++ b/Pearcleaner/Logic/Styles.swift @@ -152,6 +152,10 @@ public struct NewFeatureView: View { public var body: some View { VStack { HStack { + Image(systemName: "star") + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: 20, height: 20) Text("New features for v\((Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String)!)!") .font(.headline).bold() Spacer() diff --git a/Pearcleaner/PearcleanerApp.swift b/Pearcleaner/PearcleanerApp.swift index 110c366..0c680b7 100644 --- a/Pearcleaner/PearcleanerApp.swift +++ b/Pearcleaner/PearcleanerApp.swift @@ -144,7 +144,7 @@ struct PearcleanerApp: App { Settings { - SettingsView(showPopover: $showPopover) + SettingsView(showPopover: $showPopover, showFeature: $showFeature) .environmentObject(appState) .toolbarBackground(.clear) .preferredColorScheme(displayMode.colorScheme) diff --git a/Pearcleaner/Settings/SettingsWindow.swift b/Pearcleaner/Settings/SettingsWindow.swift index c40b256..6522a5f 100644 --- a/Pearcleaner/Settings/SettingsWindow.swift +++ b/Pearcleaner/Settings/SettingsWindow.swift @@ -10,6 +10,7 @@ import SwiftUI struct SettingsView: View { @EnvironmentObject var appState: AppState @Binding var showPopover: Bool + @Binding var showFeature: Bool @AppStorage("settings.general.glass") private var glass: Bool = true var body: some View { @@ -21,7 +22,7 @@ struct SettingsView: View { } .tag(CurrentTabView.general) - UpdateSettingsTab() + UpdateSettingsTab(showFeature: $showFeature) .tabItem { Label(CurrentTabView.update.title, systemImage: "cloud") } diff --git a/Pearcleaner/Settings/Update.swift b/Pearcleaner/Settings/Update.swift index b329500..0b54b91 100644 --- a/Pearcleaner/Settings/Update.swift +++ b/Pearcleaner/Settings/Update.swift @@ -34,7 +34,8 @@ struct UpdateSettingsTab: View { @State private var showAlert = false @State private var showDone = false @AppStorage("settings.updater.updateTimeframe") private var updateTimeframe: Int = 1 - + @Binding var showFeature: Bool + var body: some View { VStack { @@ -72,21 +73,28 @@ struct UpdateSettingsTab: View { HStack(alignment: .center, spacing: 20) { Spacer() - Button("Update Notes"){ + Button(""){ loadGithubReleases(appState: appState) } - .buttonStyle(SimpleButtonStyle(icon: "list.bullet", help: "Check release notes", color: Color("mode"))) + .buttonStyle(SimpleButtonStyle(icon: "arrow.uturn.left.circle", help: "Reload release notes", color: Color("mode"))) Spacer() - Button("Force Update"){ + Button(""){ + showFeature.toggle() + } + .buttonStyle(SimpleButtonStyle(icon: "star", help: "Show last feature alert", color: Color("mode"))) + + Spacer() + + Button(""){ loadGithubReleases(appState: appState, manual: true) } .buttonStyle(SimpleButtonStyle(icon: "arrow.down.square", help: "Check for updates", color: Color("mode"))) Spacer() - Button("GitHub"){ + Button(""){ NSWorkspace.shared.open(URL(string: "https://github.com/alienator88/Pearcleaner/releases")!) } .buttonStyle(SimpleButtonStyle(icon: "link", help: "View releases on GitHub", color: Color("mode")))