mirror of
https://github.com/exituser/Pearcleaner.git
synced 2026-09-17 06:09:01 +00:00
Update view
This commit is contained in:
@@ -152,6 +152,10 @@ public struct NewFeatureView: View {
|
|||||||
public var body: some View {
|
public var body: some View {
|
||||||
VStack {
|
VStack {
|
||||||
HStack {
|
HStack {
|
||||||
|
Image(systemName: "star")
|
||||||
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fit)
|
||||||
|
.frame(width: 20, height: 20)
|
||||||
Text("New features for v\((Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String)!)!")
|
Text("New features for v\((Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String)!)!")
|
||||||
.font(.headline).bold()
|
.font(.headline).bold()
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ struct PearcleanerApp: App {
|
|||||||
|
|
||||||
|
|
||||||
Settings {
|
Settings {
|
||||||
SettingsView(showPopover: $showPopover)
|
SettingsView(showPopover: $showPopover, showFeature: $showFeature)
|
||||||
.environmentObject(appState)
|
.environmentObject(appState)
|
||||||
.toolbarBackground(.clear)
|
.toolbarBackground(.clear)
|
||||||
.preferredColorScheme(displayMode.colorScheme)
|
.preferredColorScheme(displayMode.colorScheme)
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import SwiftUI
|
|||||||
struct SettingsView: View {
|
struct SettingsView: View {
|
||||||
@EnvironmentObject var appState: AppState
|
@EnvironmentObject var appState: AppState
|
||||||
@Binding var showPopover: Bool
|
@Binding var showPopover: Bool
|
||||||
|
@Binding var showFeature: Bool
|
||||||
@AppStorage("settings.general.glass") private var glass: Bool = true
|
@AppStorage("settings.general.glass") private var glass: Bool = true
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
@@ -21,7 +22,7 @@ struct SettingsView: View {
|
|||||||
}
|
}
|
||||||
.tag(CurrentTabView.general)
|
.tag(CurrentTabView.general)
|
||||||
|
|
||||||
UpdateSettingsTab()
|
UpdateSettingsTab(showFeature: $showFeature)
|
||||||
.tabItem {
|
.tabItem {
|
||||||
Label(CurrentTabView.update.title, systemImage: "cloud")
|
Label(CurrentTabView.update.title, systemImage: "cloud")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ struct UpdateSettingsTab: View {
|
|||||||
@State private var showAlert = false
|
@State private var showAlert = false
|
||||||
@State private var showDone = false
|
@State private var showDone = false
|
||||||
@AppStorage("settings.updater.updateTimeframe") private var updateTimeframe: Int = 1
|
@AppStorage("settings.updater.updateTimeframe") private var updateTimeframe: Int = 1
|
||||||
|
@Binding var showFeature: Bool
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
VStack {
|
||||||
@@ -72,21 +73,28 @@ struct UpdateSettingsTab: View {
|
|||||||
HStack(alignment: .center, spacing: 20) {
|
HStack(alignment: .center, spacing: 20) {
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
Button("Update Notes"){
|
Button(""){
|
||||||
loadGithubReleases(appState: appState)
|
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()
|
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)
|
loadGithubReleases(appState: appState, manual: true)
|
||||||
}
|
}
|
||||||
.buttonStyle(SimpleButtonStyle(icon: "arrow.down.square", help: "Check for updates", color: Color("mode")))
|
.buttonStyle(SimpleButtonStyle(icon: "arrow.down.square", help: "Check for updates", color: Color("mode")))
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
Button("GitHub"){
|
Button(""){
|
||||||
NSWorkspace.shared.open(URL(string: "https://github.com/alienator88/Pearcleaner/releases")!)
|
NSWorkspace.shared.open(URL(string: "https://github.com/alienator88/Pearcleaner/releases")!)
|
||||||
}
|
}
|
||||||
.buttonStyle(SimpleButtonStyle(icon: "link", help: "View releases on GitHub", color: Color("mode")))
|
.buttonStyle(SimpleButtonStyle(icon: "link", help: "View releases on GitHub", color: Color("mode")))
|
||||||
|
|||||||
Reference in New Issue
Block a user