From c7f7e14e6632a02070a73f9d41e616a09db9b522 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Fri, 28 Jun 2024 18:25:41 -0700 Subject: [PATCH] Log details level colors --- .../Views/Settings/Logs/LogDetail.swift | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/Meshtastic/Views/Settings/Logs/LogDetail.swift b/Meshtastic/Views/Settings/Logs/LogDetail.swift index c05d4b83..8006127e 100644 --- a/Meshtastic/Views/Settings/Logs/LogDetail.swift +++ b/Meshtastic/Views/Settings/Logs/LogDetail.swift @@ -81,6 +81,22 @@ struct LogDetail: View { } .padding(.bottom, 5) .listRowSeparator(.visible) + /// Level + Label { + Text("log.level".localized + ":") + .font(idiom == .phone ? .caption : .title) + .frame(width: idiom == .phone ? 115 : 190, alignment: .trailing) + Text(log.level.description) + .font(idiom == .phone ? .caption : .title) + .foregroundStyle(log.level.color) + } icon: { + Image(systemName: "stairs") + .symbolRenderingMode(.hierarchical) + .font(idiom == .phone ? .caption : .title) + .frame(width: 35) + } + .padding(.bottom, 5) + .listRowSeparator(.visible) /// Category Label { Text("log.category".localized + ":") @@ -96,21 +112,7 @@ struct LogDetail: View { } .padding(.bottom, 5) .listRowSeparator(.visible) - /// Level - Label { - Text("log.level".localized + ":") - .font(idiom == .phone ? .caption : .title) - .frame(width: idiom == .phone ? 115 : 190, alignment: .trailing) - Text(log.level.description) - .font(idiom == .phone ? .caption : .title) - } icon: { - Image(systemName: "stairs") - .symbolRenderingMode(.hierarchical) - .font(idiom == .phone ? .caption : .title) - .frame(width: 35) - } - .padding(.bottom, 5) - .listRowSeparator(.visible) + /// message Label { Text("log.message".localized + ":") @@ -119,6 +121,7 @@ struct LogDetail: View { Text(log.composedMessage) .textSelection(.enabled) .font(idiom == .phone ? .body : .title) + .foregroundStyle(log.level.color) .padding(.bottom, 5) } icon: { Image(systemName: "text.bubble")