Skip to content

Commit

Permalink
Re-add lockscreen widget setting to StatsConfig menu, and reorganize it
Browse files Browse the repository at this point in the history
  • Loading branch information
MikePlante1 committed Mar 12, 2024
1 parent 6e5766b commit 62af6b1
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions FreeAPS/Sources/Modules/StatConfig/View/StatConfigRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,22 @@ extension StatConfig {

var body: some View {
Form {
Section(header: Text("Settings")) {
Section {
Toggle("Change HbA1c Unit", isOn: $state.overrideHbA1cUnit)
Toggle("Display Chart X - Grid lines", isOn: $state.xGridLines)
Toggle("Display Chart Y - Grid lines", isOn: $state.yGridLines)
Toggle("Display Chart Threshold lines for Low and High", isOn: $state.rulerMarks)
Toggle("Standing / Laying TIR Chart", isOn: $state.oneDimensionalGraph)

HStack {
Text("Hours X-Axis (6 default)")
Spacer()
DecimalTextField("6", value: $state.hours, formatter: carbsFormatter)
Text("hours").foregroundColor(.secondary)
}
} header: { Text("Home Chart Settings") }

Section {
Toggle("Standing / Laying TIR Chart", isOn: $state.oneDimensionalGraph)
HStack {
Text("Low")
Spacer()
Expand All @@ -53,10 +55,21 @@ extension StatConfig {
DecimalTextField("0", value: $state.high, formatter: glucoseFormatter)
Text(state.units.rawValue).foregroundColor(.secondary)
}
}
} header: { Text("Statistics") }

Section {
Picker(
selection: $state.lockScreenView,
label: Text("Lock screen widget")
) {
ForEach(LockScreenView.allCases) { selection in
Text(selection.displayName).tag(selection)
}
}
} header: { Text("Lock screen widget") }
}
.onAppear(perform: configureView)
.navigationBarTitle("Statistics")
.navigationBarTitle("UI/UX")
.navigationBarTitleDisplayMode(.automatic)
}
}
Expand Down

0 comments on commit 62af6b1

Please sign in to comment.