mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
New smaller style for node history pins
This commit is contained in:
parent
385fc6ac73
commit
d07da6298b
3 changed files with 29 additions and 17 deletions
|
|
@ -156,17 +156,18 @@ struct NodeMapSwiftUI: View {
|
|||
if showNodeHistory {
|
||||
if pf.contains(.Heading) {
|
||||
Image(systemName: pf.contains(.Speed) && position.speed > 1 ? "location.north.circle" : "hexagon")
|
||||
.padding(2)
|
||||
.foregroundStyle(Color(UIColor(hex: UInt32(node.num)).lighter()).isLight() ? .black : .white)
|
||||
.foregroundStyle(Color(UIColor(hex: UInt32(node.num))).isLight() ? .black : .white)
|
||||
.background(Color(UIColor(hex: UInt32(node.num)).lighter()))
|
||||
.clipShape(Circle())
|
||||
.rotationEffect(headingDegrees)
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.frame(width: 16, height: 16)
|
||||
} else {
|
||||
Image(systemName: "mappin.circle")
|
||||
.padding(2)
|
||||
.foregroundStyle(Color(UIColor(hex: UInt32(node.num)).lighter()).isLight() ? .black : .white)
|
||||
.background(Color(UIColor(hex: UInt32(node.num)).lighter()))
|
||||
.clipShape(Circle())
|
||||
Circle()
|
||||
.fill(Color(UIColor(hex: UInt32(node.num)).lighter()))
|
||||
.strokeBorder(Color(UIColor(hex: UInt32(node.num))).isLight() ? .black : .white ,lineWidth: 2)
|
||||
.frame(width: 12, height: 12)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -201,7 +202,6 @@ struct NodeMapSwiftUI: View {
|
|||
}
|
||||
}
|
||||
.popover(item: $selectedWaypoint, attachmentAnchor: .rect(.rect(selectedWaypointRect)), arrowEdge: .bottom) { selection in
|
||||
//.popover(isPresented: $showingWaypointPopover, arrowEdge: .bottom) {
|
||||
WaypointPopover(waypoint: selection)
|
||||
.padding()
|
||||
.opacity(0.8)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ struct MQTTConfig: View {
|
|||
@State var address = ""
|
||||
@State var username = ""
|
||||
@State var password = ""
|
||||
@State var encryptionEnabled = false
|
||||
@State var encryptionEnabled = true
|
||||
@State var jsonEnabled = false
|
||||
@State var tlsEnabled = true
|
||||
@State var root = "msh"
|
||||
|
|
@ -63,7 +63,7 @@ struct MQTTConfig: View {
|
|||
Label("mqtt.clientproxy", systemImage: "iphone.radiowaves.left.and.right")
|
||||
}
|
||||
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
||||
Text("If both MQTT and the client proxy are enabled your device will utalize an available network connection to connect to the specified MQTT server.")
|
||||
Text("If both MQTT and the client proxy are enabled your mobile device will utalize an available network connection to connect to the specified MQTT server.")
|
||||
.font(.caption2)
|
||||
|
||||
Toggle(isOn: $encryptionEnabled) {
|
||||
|
|
@ -71,17 +71,22 @@ struct MQTTConfig: View {
|
|||
Label("Encryption Enabled", systemImage: "lock.icloud")
|
||||
}
|
||||
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
||||
|
||||
Toggle(isOn: $tlsEnabled) {
|
||||
|
||||
Label("TLS Enabled", systemImage: "checkmark.shield.fill")
|
||||
}
|
||||
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
||||
|
||||
Toggle(isOn: $jsonEnabled) {
|
||||
|
||||
Label("JSON Enabled", systemImage: "ellipsis.curlybraces")
|
||||
}
|
||||
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
||||
Text("JSON mode is a limited, unencrypted MQTT output.")
|
||||
.font(.caption2)
|
||||
|
||||
Toggle(isOn: $tlsEnabled) {
|
||||
|
||||
Label("TLS Enabled", systemImage: "checkmark.shield.fill")
|
||||
}
|
||||
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
||||
Text("Your MQTT Server must support TLS.")
|
||||
.font(.caption2)
|
||||
}
|
||||
Section(header: Text("Custom Server")) {
|
||||
HStack {
|
||||
|
|
@ -284,11 +289,18 @@ struct MQTTConfig: View {
|
|||
.onChange(of: encryptionEnabled) { newEncryptionEnabled in
|
||||
if node != nil && node?.mqttConfig != nil {
|
||||
if newEncryptionEnabled != node!.mqttConfig!.encryptionEnabled { hasChanges = true }
|
||||
if newEncryptionEnabled {
|
||||
jsonEnabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
.onChange(of: jsonEnabled) { newJsonEnabled in
|
||||
if node != nil && node?.mqttConfig != nil {
|
||||
if newJsonEnabled != node!.mqttConfig!.jsonEnabled { hasChanges = true }
|
||||
|
||||
if newJsonEnabled {
|
||||
encryptionEnabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
.onChange(of: tlsEnabled) { newTlsEnabled in
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ struct StoreForwardConfig: View {
|
|||
}
|
||||
}
|
||||
.scrollDismissesKeyboard(.interactively)
|
||||
.disabled(self.bleManager.connectedPeripheral == nil || node?.detectionSensorConfig == nil)
|
||||
.disabled(self.bleManager.connectedPeripheral == nil || node?.storeForwardConfig == nil)
|
||||
|
||||
Button {
|
||||
isPresentingSaveConfirm = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue