mirror of
https://github.com/exituser/Pearcleaner.git
synced 2026-09-17 07:19:04 +00:00
v1.2
This commit is contained in:
@@ -11,8 +11,10 @@ import SwiftUI
|
||||
struct GeneralSettingsTab: View {
|
||||
@EnvironmentObject var appState: AppState
|
||||
@AppStorage("settings.general.glass") private var glass: Bool = true
|
||||
// @AppStorage("settings.general.ants") private var ants: Bool = false
|
||||
|
||||
@AppStorage("settings.general.mini") private var mini: Bool = false
|
||||
@AppStorage("settings.general.dark") var isDark: Bool = true
|
||||
@AppStorage("displayMode") var displayMode: DisplayMode = .dark
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
VStack {
|
||||
@@ -34,30 +36,54 @@ struct GeneralSettingsTab: View {
|
||||
.fill(Color("mode").opacity(0.05))
|
||||
)
|
||||
|
||||
// HStack {
|
||||
// VStack(alignment: .leading, spacing: 5) {
|
||||
// Text("Animation").font(.title2)
|
||||
// Text("Toggles the marching ants animation on the drop zone")
|
||||
// .font(.footnote)
|
||||
// .foregroundStyle(.gray)
|
||||
// }
|
||||
// Spacer()
|
||||
// Toggle(isOn: $ants, label: {
|
||||
// })
|
||||
// .toggleStyle(.switch)
|
||||
// }
|
||||
// .padding()
|
||||
// .background(
|
||||
// RoundedRectangle(cornerRadius: 8)
|
||||
// .fill(Color("mode").opacity(0.05))
|
||||
// )
|
||||
HStack {
|
||||
VStack(alignment: .leading, spacing: 5) {
|
||||
Text("Dark Mode").font(.title2)
|
||||
Text("Toggles between dark and light mode")
|
||||
.font(.footnote)
|
||||
.foregroundStyle(.gray)
|
||||
}
|
||||
Spacer()
|
||||
Toggle(isOn: $isDark, label: {
|
||||
})
|
||||
.toggleStyle(.switch)
|
||||
.onChange(of: isDark) { newValue in
|
||||
displayMode.colorScheme = newValue ? .dark : .light
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 8)
|
||||
.fill(Color("mode").opacity(0.05))
|
||||
)
|
||||
|
||||
HStack {
|
||||
VStack(alignment: .leading, spacing: 5) {
|
||||
Text("Mini").font(.title2)
|
||||
Text("Toggles a smaller, unified view with hidden app list")
|
||||
.font(.footnote)
|
||||
.foregroundStyle(.gray)
|
||||
}
|
||||
Spacer()
|
||||
Toggle(isOn: $mini, label: {
|
||||
})
|
||||
.toggleStyle(.switch)
|
||||
.onChange(of: mini) { newVal in
|
||||
resizeWindow()
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 8)
|
||||
.fill(Color("mode").opacity(0.05))
|
||||
)
|
||||
|
||||
Spacer()
|
||||
}
|
||||
|
||||
}
|
||||
.padding(20)
|
||||
.frame(width: 400, height: 100)
|
||||
.frame(width: 400, height: 250)
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user