better layout of the advanced sections
This commit is contained in:
@@ -886,18 +886,6 @@ struct BatteryEditorView: View {
|
|||||||
.listRowSeparator(.hidden)
|
.listRowSeparator(.hidden)
|
||||||
.listRowBackground(Color(.systemBackground))
|
.listRowBackground(Color(.systemBackground))
|
||||||
}
|
}
|
||||||
} footer: {
|
|
||||||
if isAdvancedExpanded {
|
|
||||||
VStack(alignment: .leading, spacing: 8) {
|
|
||||||
Text(usableCapacityFooterText)
|
|
||||||
Text(chargeVoltageHelperText)
|
|
||||||
Text(cutOffVoltageHelperText)
|
|
||||||
Text(temperatureRangeHelperText)
|
|
||||||
}
|
|
||||||
.font(.caption)
|
|
||||||
.foregroundStyle(.secondary)
|
|
||||||
.opacity(advancedEnabled ? 1 : 0.35)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.listRowSeparator(.hidden)
|
.listRowSeparator(.hidden)
|
||||||
.listRowInsets(EdgeInsets(top: 12, leading: 18, bottom: 12, trailing: 18))
|
.listRowInsets(EdgeInsets(top: 12, leading: 18, bottom: 12, trailing: 18))
|
||||||
@@ -906,6 +894,7 @@ struct BatteryEditorView: View {
|
|||||||
|
|
||||||
private var advancedControls: some View {
|
private var advancedControls: some View {
|
||||||
VStack(spacing: 16) {
|
VStack(spacing: 16) {
|
||||||
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
EditableSliderRow(
|
EditableSliderRow(
|
||||||
title: usableCapacitySliderTitle,
|
title: usableCapacitySliderTitle,
|
||||||
unit: "%",
|
unit: "%",
|
||||||
@@ -932,7 +921,12 @@ struct BatteryEditorView: View {
|
|||||||
saveTitle: alertSaveTitle
|
saveTitle: alertSaveTitle
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
Text(usableCapacityFooterText)
|
||||||
|
.font(.caption)
|
||||||
|
.foregroundStyle(.secondary)
|
||||||
|
}
|
||||||
|
|
||||||
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
EditableSliderRow(
|
EditableSliderRow(
|
||||||
title: chargeVoltageTitle,
|
title: chargeVoltageTitle,
|
||||||
unit: "V",
|
unit: "V",
|
||||||
@@ -957,7 +951,12 @@ struct BatteryEditorView: View {
|
|||||||
saveTitle: alertSaveTitle
|
saveTitle: alertSaveTitle
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
Text(chargeVoltageHelperText)
|
||||||
|
.font(.caption)
|
||||||
|
.foregroundStyle(.secondary)
|
||||||
|
}
|
||||||
|
|
||||||
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
EditableSliderRow(
|
EditableSliderRow(
|
||||||
title: cutOffVoltageTitle,
|
title: cutOffVoltageTitle,
|
||||||
unit: "V",
|
unit: "V",
|
||||||
@@ -982,8 +981,17 @@ struct BatteryEditorView: View {
|
|||||||
saveTitle: alertSaveTitle
|
saveTitle: alertSaveTitle
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
Text(cutOffVoltageHelperText)
|
||||||
|
.font(.caption)
|
||||||
|
.foregroundStyle(.secondary)
|
||||||
|
}
|
||||||
|
|
||||||
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
temperatureRangeRow
|
temperatureRangeRow
|
||||||
|
Text(temperatureRangeHelperText)
|
||||||
|
.font(.caption)
|
||||||
|
.foregroundStyle(.secondary)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.padding(.top, 6)
|
.padding(.top, 6)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1040,28 +1040,31 @@ struct CalculatorView: View {
|
|||||||
.listRowSeparator(.hidden)
|
.listRowSeparator(.hidden)
|
||||||
.listRowBackground(Color(.systemBackground))
|
.listRowBackground(Color(.systemBackground))
|
||||||
}
|
}
|
||||||
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
dutyCycleSlider
|
dutyCycleSlider
|
||||||
.listRowSeparator(.hidden)
|
.listRowSeparator(.hidden)
|
||||||
.listRowBackground(Color(.systemBackground))
|
.listRowBackground(Color(.systemBackground))
|
||||||
.opacity(advancedEnabled ? 1 : 0.35)
|
.opacity(advancedEnabled ? 1 : 0.35)
|
||||||
.allowsHitTesting(advancedEnabled)
|
.allowsHitTesting(advancedEnabled)
|
||||||
|
Text(dutyCycleHelperText)
|
||||||
|
.font(.caption)
|
||||||
|
.foregroundStyle(.secondary)
|
||||||
|
.opacity(advancedEnabled ? 1 : 0.35)
|
||||||
|
}
|
||||||
|
|
||||||
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
usageHoursSlider
|
usageHoursSlider
|
||||||
.listRowSeparator(.hidden)
|
.listRowSeparator(.hidden)
|
||||||
.listRowBackground(Color(.systemBackground))
|
.listRowBackground(Color(.systemBackground))
|
||||||
.opacity(advancedEnabled ? 1 : 0.35)
|
.opacity(advancedEnabled ? 1 : 0.35)
|
||||||
.allowsHitTesting(advancedEnabled)
|
.allowsHitTesting(advancedEnabled)
|
||||||
}
|
|
||||||
} footer: {
|
|
||||||
if isAdvancedExpanded {
|
|
||||||
VStack(alignment: .leading, spacing: 8) {
|
|
||||||
Text(dutyCycleHelperText)
|
|
||||||
Text(usageHoursHelperText)
|
Text(usageHoursHelperText)
|
||||||
}
|
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
.opacity(advancedEnabled ? 1 : 0.35)
|
.opacity(advancedEnabled ? 1 : 0.35)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
.listRowSeparator(.hidden)
|
.listRowSeparator(.hidden)
|
||||||
.listRowInsets(EdgeInsets(top: 12, leading: 18, bottom: 12, trailing: 18))
|
.listRowInsets(EdgeInsets(top: 12, leading: 18, bottom: 12, trailing: 18))
|
||||||
.animation(.easeInOut(duration: 0.2), value: isAdvancedExpanded)
|
.animation(.easeInOut(duration: 0.2), value: isAdvancedExpanded)
|
||||||
|
|||||||
Reference in New Issue
Block a user