|
|
@@ -1,8 +1,8 @@
|
|
|
import SwiftUI
|
|
|
|
|
|
struct InfoText: Identifiable {
|
|
|
- var id: String { name }
|
|
|
- let name: String
|
|
|
+ var id: String { description }
|
|
|
+ let description: String
|
|
|
let oref0Variable: String
|
|
|
}
|
|
|
|
|
|
@@ -46,7 +46,7 @@ extension PreferencesEditor {
|
|
|
ForEach(viewModel.boolFields.indexed(), id: \.1.id) { index, field in
|
|
|
HStack {
|
|
|
Button("", action: {
|
|
|
- infoButtonPressed = InfoText(name: field.infoText, oref0Variable: field.displayName)
|
|
|
+ infoButtonPressed = InfoText(description: field.infoText, oref0Variable: field.displayName)
|
|
|
})
|
|
|
Toggle(field.displayName, isOn: self.$viewModel.boolFields[index].value)
|
|
|
}
|
|
|
@@ -54,7 +54,7 @@ extension PreferencesEditor {
|
|
|
.alert(item: $infoButtonPressed) { infoButton in
|
|
|
Alert(
|
|
|
title: Text(infoButton.oref0Variable),
|
|
|
- message: Text(infoButton.name),
|
|
|
+ message: Text(infoButton.description),
|
|
|
dismissButton: .default(Text("OK"))
|
|
|
)
|
|
|
}
|
|
|
@@ -62,7 +62,7 @@ extension PreferencesEditor {
|
|
|
ForEach(viewModel.decimalFields.indexed(), id: \.1.id) { index, field in
|
|
|
HStack {
|
|
|
Button("", action: {
|
|
|
- infoButtonPressed = InfoText(name: field.infoText, oref0Variable: field.displayName)
|
|
|
+ infoButtonPressed = InfoText(description: field.infoText, oref0Variable: field.displayName)
|
|
|
})
|
|
|
Text(field.displayName)
|
|
|
DecimalTextField("0", value: self.$viewModel.decimalFields[index].value, formatter: formatter)
|
|
|
@@ -71,7 +71,7 @@ extension PreferencesEditor {
|
|
|
.alert(item: $infoButtonPressed) { infoButton in
|
|
|
Alert(
|
|
|
title: Text(infoButton.oref0Variable),
|
|
|
- message: Text(infoButton.name),
|
|
|
+ message: Text(infoButton.description),
|
|
|
dismissButton: .default(Text("OK"))
|
|
|
)
|
|
|
}
|