Update view

This commit is contained in:
Alin
2024-03-11 12:27:57 -06:00
parent 0dfe1c8d2b
commit f62148d08a
4 changed files with 20 additions and 7 deletions
+2 -1
View File
@@ -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")
}
+13 -5
View File
@@ -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")))