feat: toolbar items

This commit is contained in:
mrFq1
2023-05-27 18:14:13 +08:00
parent 33a4eab579
commit 30922826e8
8 changed files with 134 additions and 54 deletions
@@ -8,9 +8,11 @@ import SwiftUI
struct ProvidersView: View {
@ObservedObject var providerStorage = DBProviderStorage()
@EnvironmentObject var hideProxyNames: HideProxyNames
@State private var searchString = ProxiesSearchString()
@StateObject private var hideProxyNames = HideProxyNames()
var body: some View {
NavigationView {
@@ -40,6 +42,16 @@ struct ProvidersView: View {
.onAppear {
loadProviders()
}
.environmentObject(hideProxyNames)
.toolbar {
ToolbarItem {
Button {
hideProxyNames.hide = !hideProxyNames.hide
} label: {
Image(systemName: hideProxyNames.hide ? "eyeglasses" : "wand.and.stars")
}
}
}
}
func loadProviders() {