mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Dismiss buttons for sheets on mac
Add icon to clear app data button Convert settings view to navigationsplitview
This commit is contained in:
parent
9efec04b7d
commit
f259cb15fd
5 changed files with 14 additions and 13 deletions
|
|
@ -8,7 +8,7 @@ import SwiftUI
|
|||
|
||||
struct InvalidVersion: View {
|
||||
|
||||
@Environment(\.presentationMode) private var presentationMode
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
@State var minimumVersion = ""
|
||||
@State var version = ""
|
||||
|
|
@ -64,7 +64,7 @@ struct InvalidVersion: View {
|
|||
|
||||
#if targetEnvironment(macCatalyst)
|
||||
Button {
|
||||
presentationMode.wrappedValue.dismiss()
|
||||
dismiss()
|
||||
} label: {
|
||||
Label("Close", systemImage: "xmark")
|
||||
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ struct Contacts: View {
|
|||
UserMessageList(user:user)
|
||||
|
||||
} else {
|
||||
Text("Select a user")
|
||||
Text("Select a Contact")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,9 +159,11 @@ struct AppSettings: View {
|
|||
}
|
||||
}
|
||||
HStack {
|
||||
|
||||
Button("Clear App Data", role: .destructive) {
|
||||
Button {
|
||||
isPresentingCoreDataResetConfirm = true
|
||||
} label: {
|
||||
Label("Clear App Data", systemImage: "clear")
|
||||
.foregroundColor(.red)
|
||||
}
|
||||
.buttonStyle(.bordered)
|
||||
.buttonBorderShape(.capsule)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import SwiftUI
|
|||
|
||||
struct SaveChannelQRCode: View {
|
||||
|
||||
@Environment(\.presentationMode) private var presentationMode
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
var channelSetLink: String
|
||||
var bleManager: BLEManager
|
||||
|
|
@ -28,7 +28,7 @@ struct SaveChannelQRCode: View {
|
|||
Button {
|
||||
let success = bleManager.saveChannelSet(base64UrlString: channelSetLink)
|
||||
if success {
|
||||
presentationMode.wrappedValue.dismiss()
|
||||
dismiss()
|
||||
}
|
||||
|
||||
} label: {
|
||||
|
|
@ -42,7 +42,7 @@ struct SaveChannelQRCode: View {
|
|||
|
||||
#if targetEnvironment(macCatalyst)
|
||||
Button {
|
||||
presentationMode.wrappedValue.dismiss()
|
||||
dismiss()
|
||||
} label: {
|
||||
Label("Cancel", systemImage: "xmark")
|
||||
|
||||
|
|
|
|||
|
|
@ -12,15 +12,12 @@ struct Settings: View {
|
|||
@Environment(\.managedObjectContext) var context
|
||||
@EnvironmentObject var bleManager: BLEManager
|
||||
@EnvironmentObject var userSettings: UserSettings
|
||||
|
||||
@FetchRequest(sortDescriptors: [NSSortDescriptor(key: "lastHeard", ascending: false)], animation: .default)
|
||||
private var nodes: FetchedResults<NodeInfoEntity>
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
|
||||
NavigationSplitView {
|
||||
List {
|
||||
|
||||
let connectedNodeNum = bleManager.connectedPeripheral != nil ? bleManager.connectedPeripheral.num : 0
|
||||
|
||||
NavigationLink() {
|
||||
|
|
@ -31,7 +28,6 @@ struct Settings: View {
|
|||
.symbolRenderingMode(.hierarchical)
|
||||
Text("App Settings")
|
||||
}
|
||||
|
||||
Section("Radio Configuration") {
|
||||
|
||||
NavigationLink {
|
||||
|
|
@ -201,5 +197,8 @@ struct Settings: View {
|
|||
MeshtasticLogo()
|
||||
)
|
||||
}
|
||||
detail: {
|
||||
Text("Select an item from the menu")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue