Merge branch '2.3.10_Working_Changes' into main

This commit is contained in:
Garth Vander Houwen 2024-06-01 07:30:50 -07:00 committed by GitHub
commit fe82f1c3df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 38 additions and 14 deletions

View file

@ -7,6 +7,40 @@
import Foundation
enum NagIntervals: Int, CaseIterable, Identifiable {
case unset = 0
case oneSecond = 1
case fiveSeconds = 5
case tenSeconds = 10
case fifteenSeconds = 15
case thirtySeconds = 30
case oneMinute = 60
case fiveMinutes = 300
var id: Int { self.rawValue }
var description: String {
switch self {
case .unset:
return "unset".localized
case .oneSecond:
return "interval.one.second".localized
case .fiveSeconds:
return "interval.five.seconds".localized
case .tenSeconds:
return "interval.ten.seconds".localized
case .fifteenSeconds:
return "interval.fifteen.seconds".localized
case .thirtySeconds:
return "interval.thirty.seconds".localized
case .oneMinute:
return "interval.one.minute".localized
case .fiveMinutes:
return "interval.five.minutes".localized
}
}
}
enum OutputIntervals: Int, CaseIterable, Identifiable {
case unset = 0

View file

@ -16,22 +16,12 @@ struct CircleText: View {
Circle()
.fill(color)
.frame(width: circleSize, height: circleSize)
#if os(macOS)
Text(text)
.frame(width: circleSize * 0.95, height: circleSize * 0.95, alignment: .center)
.frame(width: circleSize * 0.9, height: circleSize * 0.9, alignment: .center)
.foregroundColor(color.isLight() ? .black : .white)
.font(.system(size: 3000))
.minimumScaleFactor(0.001)
#else
Text(text)
.frame(width: circleSize * 0.95, height: circleSize * 0.95, alignment: .center)
.foregroundColor(color.isLight() ? .black : .white)
.font(.system(size: 5000))
.minimumScaleFactor(0.001)
#endif
.font(.system(size: 1300))
}
.aspectRatio(1, contentMode: .fit)
}
}

View file

@ -25,7 +25,7 @@ struct NodeInfoItem: View {
}
if node.user != nil {
Divider()
VStack {
VStack (alignment: .center) {
if node.user?.hwModel != "UNSET" {
Image(node.user!.hwModel ?? "unset".localized)
.resizable()

View file

@ -102,7 +102,7 @@ struct ExternalNotificationConfig: View {
.listRowSeparator(.visible)
Picker("Nag timeout", selection: $nagTimeout ) {
ForEach(OutputIntervals.allCases) { oi in
ForEach(NagIntervals.allCases) { oi in
Text(oi.description)
}
}