Creates modifier for customInsetGrouped rows

This commit is contained in:
Stuart Breckenridge
2022-12-22 08:42:43 +08:00
parent 89b1de92f1
commit bb40169dda
3 changed files with 42 additions and 17 deletions

View File

@@ -16,19 +16,12 @@ struct TimelineCustomizerView: View {
var body: some View {
List {
Section(header: Text("Icon Size", comment: "Timline Customiser: Icon size section header")) {
ZStack {
TickMarkSliderView(minValue: 1, maxValue: 3, currentValue: Binding(get: {
Float(appDefaults.timelineIconSize.rawValue)
}, set: { AppDefaults.shared.timelineIconSize = IconSize(rawValue: Int($0))! }))
}
.padding(.horizontal, 16)
.padding(.vertical, 8)
.listRowInsets(EdgeInsets(top: 0, leading: 15, bottom: 0, trailing: 15))
.background(
RoundedRectangle(cornerRadius: 8)
.foregroundColor(Color(uiColor: UIColor.secondarySystemGroupedBackground))
)
.customInsetGroupedRowStyle()
}
.listRowInsets(EdgeInsets(top: 0, leading: 30, bottom: 0, trailing: 30))
.listRowBackground(Color.clear)
@@ -40,13 +33,7 @@ struct TimelineCustomizerView: View {
Float(appDefaults.timelineNumberOfLines)
}, set: { appDefaults.timelineNumberOfLines = Int($0) }))
}
.padding(.horizontal, 16)
.padding(.vertical, 8)
.listRowInsets(EdgeInsets(top: 0, leading: 15, bottom: 0, trailing: 15))
.background(
RoundedRectangle(cornerRadius: 8)
.foregroundColor(Color(uiColor: UIColor.secondarySystemGroupedBackground))
)
.customInsetGroupedRowStyle()
}
.listRowInsets(EdgeInsets(top: 0, leading: 30, bottom: 0, trailing: 30))
.listRowBackground(Color.clear)