mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Implement various text circle sizes
This commit is contained in:
parent
7741d63e0c
commit
e7a74145ad
5 changed files with 29 additions and 18 deletions
|
|
@ -808,7 +808,14 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
print("💥 Error Fetching NodeInfoEntity for NODEINFO_APP")
|
||||
}
|
||||
|
||||
} else if decodedInfo.packet.decoded.portnum == PortNum.adminApp {
|
||||
|
||||
//
|
||||
} else if decodedInfo.packet.decoded.portnum == PortNum.storeForwardApp {
|
||||
|
||||
if meshLoggingEnabled { MeshLogger.log("🚨 MESH PACKET received for Store Forward App UNHANDLED \(try decodedInfo.packet.jsonString())") }
|
||||
print("🚨 MESH PACKET received for Admin App UNHANDLED \(try decodedInfo.packet.jsonString())")
|
||||
|
||||
} else if decodedInfo.packet.decoded.portnum == PortNum.adminApp {
|
||||
|
||||
if meshLoggingEnabled { MeshLogger.log("🚨 MESH PACKET received for Admin App UNHANDLED \(try decodedInfo.packet.jsonString())") }
|
||||
print("🚨 MESH PACKET received for Admin App UNHANDLED \(try decodedInfo.packet.jsonString())")
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ import SwiftUI
|
|||
struct CircleText: View {
|
||||
var text: String
|
||||
var color: Color
|
||||
var circleSize: CGFloat? = 40
|
||||
var fontSize: CGFloat? = 16
|
||||
var circleSize: CGFloat? = 50
|
||||
var fontSize: CGFloat? = 24
|
||||
|
||||
var body: some View {
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,11 @@ struct UserMessageList: View {
|
|||
ScrollView {
|
||||
|
||||
if allMessages.count > 0 {
|
||||
|
||||
|
||||
HStack{
|
||||
// Padding at the top of the message list
|
||||
}.padding(.bottom)
|
||||
|
||||
ForEach( allMessages ) { (message: MessageEntity) in
|
||||
|
||||
let currentUser: Bool = (bleManager.connectedPeripheral == nil) ? false : ((bleManager.connectedPeripheral != nil && bleManager.connectedPeripheral.num == message.fromUser?.num) ? true : false )
|
||||
|
|
@ -54,8 +58,7 @@ struct UserMessageList: View {
|
|||
if currentUser { Spacer(minLength:50) }
|
||||
|
||||
if !currentUser {
|
||||
|
||||
CircleText(text: (message.fromUser?.shortName ?? "???"), color: currentUser ? .accentColor : Color(.darkGray)).padding(.all, 5)
|
||||
CircleText(text: message.fromUser?.shortName ?? "???", color: currentUser ? .accentColor : Color(.darkGray), circleSize: 36, fontSize: 16).padding(.all, 5)
|
||||
}
|
||||
|
||||
VStack(alignment: currentUser ? .trailing : .leading) {
|
||||
|
|
@ -296,8 +299,8 @@ struct UserMessageList: View {
|
|||
|
||||
HStack {
|
||||
|
||||
CircleText(text: user.shortName ?? "???", color: .blue).fixedSize()
|
||||
Text(user.longName ?? "Unknown").foregroundColor(.gray).font(.caption2).fixedSize()
|
||||
CircleText(text: user.shortName ?? "???", color: .blue, circleSize: 42, fontSize: 20).fixedSize()
|
||||
Text(user.longName ?? "Unknown").font(.headline).fixedSize()
|
||||
}
|
||||
}
|
||||
ToolbarItem(placement: .navigationBarTrailing) {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ struct NodeDetail: View {
|
|||
MapAnnotation(
|
||||
coordinate: location.coordinate,
|
||||
content: {
|
||||
CircleText(text: node.user!.shortName ?? "???", color: .accentColor)
|
||||
CircleText(text: node.user!.shortName ?? "???", color: .accentColor, circleSize: 33, fontSize: 16)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,7 +157,15 @@ struct AppSettings: View {
|
|||
}
|
||||
.pickerStyle(DefaultPickerStyle())
|
||||
}
|
||||
Section(header: Text("MESH NETWORK OPTIONS")) {
|
||||
Section(header: Text("MAP OPTIONS")) {
|
||||
Picker("Map Type", selection: $userSettings.meshMapType) {
|
||||
ForEach(MeshMapType.allCases) { map in
|
||||
Text(map.description)
|
||||
}
|
||||
}
|
||||
.pickerStyle(DefaultPickerStyle())
|
||||
}
|
||||
Section(header: Text("DEBUG")) {
|
||||
// Toggle(isOn: $userSettings.meshActivityLog) {
|
||||
|
||||
// Label("Log all Mesh activity", systemImage: "network")
|
||||
|
|
@ -170,14 +178,7 @@ struct AppSettings: View {
|
|||
.listRowSeparator(.visible)
|
||||
}
|
||||
}
|
||||
Section(header: Text("MAP OPTIONS")) {
|
||||
Picker("Map Type", selection: $userSettings.meshMapType) {
|
||||
ForEach(MeshMapType.allCases) { map in
|
||||
Text(map.description)
|
||||
}
|
||||
}
|
||||
.pickerStyle(DefaultPickerStyle())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.navigationTitle("App Settings")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue