Skip to content

Commit

Permalink
fix(qml): Set num_samplers to required number in QML UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Feb 17, 2024
1 parent d7a769b commit 88aa2fc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion res/qml/SamplerRow.qml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import Mixxx 1.0 as Mixxx
import "." as Skin
import QtQuick 2.12
import QtQuick.Layouts 1.12

RowLayout {
spacing: 0

Mixxx.ControlProxy {
id: numSamplersControl

group: "[App]"
key: "num_samplers"
}

Repeater {
model: 8
model: Math.trunc(Mixxx.MathUtils.clamp(numSamplersControl.value, 4, 8));

Skin.Sampler {
required property int index
Expand All @@ -15,4 +23,8 @@ RowLayout {
group: "[Sampler" + (index + 1) + "]"
}
}

Component.onCompleted: if (numSamplersControl.value < 8) {
numSamplersControl.value = 8;
}
}

0 comments on commit 88aa2fc

Please sign in to comment.