Merge pull request #498 from meshtastic/channelkey_editor

Use a segmented picker so you can see the disabled role
This commit is contained in:
Garth Vander Houwen 2024-02-16 21:44:21 -08:00 committed by GitHub
commit 5134e1d65d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -200,16 +200,20 @@ struct Channels: View {
})
.disabled(channelKeySize <= 0)
}
Picker("Channel Role", selection: $channelRole) {
if channelRole == 1 {
Text("Primary").tag(1)
} else {
Text("Disabled").tag(0)
Text("Secondary").tag(2)
HStack {
Text("Role")
Spacer()
Picker("Channel Role", selection: $channelRole) {
if channelRole == 1 {
Text("Primary").tag(1)
} else {
Text("Disabled").tag(0)
Text("Secondary").tag(2)
}
}
.pickerStyle(.segmented)
.disabled(channelRole == 1)
}
.pickerStyle(DefaultPickerStyle())
.disabled(channelRole == 1)
Toggle("Uplink Enabled", isOn: $uplink)
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
Toggle("Downlink Enabled", isOn: $downlink)