Skip to content

Commit 25e9647

Browse files
committed
Add more params in iPad size
1 parent 59f2ab4 commit 25e9647

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Cookbook/CookbookCommon/Sources/CookbookCommon/Recipes/MiniApps/InstrumentSFZ.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@ class InstrumentSFZConductor: ObservableObject, HasAudioEngine {
3535
struct InstrumentSFZView: View {
3636
@StateObject var conductor = InstrumentSFZConductor()
3737
@Environment(\.colorScheme) var colorScheme
38+
@Environment(\.horizontalSizeClass) var horizontalSizeClass
3839

3940
var body: some View {
4041
let instrumentParams = conductor.instrument.parameters
4142
let instrumentParamsSorted = instrumentParams.sorted(by: {$0.def.name < $1.def.name} )
42-
let instrumentParamsChunked = instrumentParamsSorted.chunked(into: 6)
43+
let paramsPerLine = horizontalSizeClass == .compact ? 6 : 8
44+
let instrumentParamsChunked = instrumentParamsSorted.chunked(into: paramsPerLine)
45+
4346
GeometryReader { geoProxy in
4447
VStack {
4548
ScrollView {

0 commit comments

Comments
 (0)