mirror of
https://github.com/exituser/Pearcleaner.git
synced 2026-09-17 04:58:56 +00:00
Update view
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -144,7 +144,7 @@ struct PearcleanerApp: App {
|
||||
|
||||
|
||||
Settings {
|
||||
SettingsView(showPopover: $showPopover)
|
||||
SettingsView(showPopover: $showPopover, showFeature: $showFeature)
|
||||
.environmentObject(appState)
|
||||
.toolbarBackground(.clear)
|
||||
.preferredColorScheme(displayMode.colorScheme)
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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")))
|
||||
|
||||
Reference in New Issue
Block a user