refactor: replace deprecated APIs

I replaced deprecated SwiftUI APIs with new ones.
This commit is contained in:
Kenta Kubo 2024-06-06 02:17:32 +09:00
parent bbab4c95b7
commit fcc41a2bcd
No known key found for this signature in database
GPG key ID: 3D79E20285C94BE8
2 changed files with 5 additions and 5 deletions

View file

@ -267,7 +267,7 @@ extension ContentView: View {
}
@ToolbarContentBuilder private var toolbarContent: some ToolbarContent {
ToolbarItem(placement: .navigationBarLeading) {
ToolbarItem(placement: .topBarLeading) {
Menu {
Button("DNS-over-TLS", action: self.addNewDoTServer)
Button("DNS-over-HTTPS", action: self.addNewDoHServer)
@ -275,7 +275,7 @@ extension ContentView: View {
Image(systemName: "plus")
}
}
ToolbarItem(placement: .navigationBarTrailing) {
ToolbarItem(placement: .topBarTrailing) {
EditButton()
}
ToolbarItem(placement: .status) {
@ -283,7 +283,7 @@ extension ContentView: View {
HStack {
Circle()
.frame(width: 10, height: 10)
.foregroundColor(self.isEnabled ? .green : .secondary)
.foregroundStyle(self.isEnabled ? .green : .secondary)
Text(self.isEnabled ? "Active" : "Inactive")
#if targetEnvironment(macCatalyst)
Text("-")
@ -307,7 +307,7 @@ extension ContentView: View {
VStack(alignment: .leading) {
Text(self.servers[i].name)
Text(self.servers[i].configuration.description)
.foregroundColor(.secondary)
.foregroundStyle(.secondary)
}
if self.usedID == self.servers[i].id.uuidString {
Spacer()

View file

@ -30,7 +30,7 @@ extension LazyTextField: View {
self.text.removeAll()
} label: {
Image(systemName: "xmark.circle.fill")
.foregroundColor(.primary)
.foregroundStyle(Color.primary)
.opacity(0.2)
}
.buttonStyle(.borderless)