5import QGroundControl.Controls
7/// Generic increment/decrement control for a numeric Fact.
8/// Shows a label, a "-" button, the current value with its units,
9/// and a "+" button. Clamped to fact.min / fact.max.
12/// fact - The Fact to control (required).
13/// label - Display label (defaults to fact.label).
14/// step - Amount added/subtracted per click (default 5).
18 property string label: fact.label
22 spacing: ScreenTools.defaultFontPixelWidth * 2
25 Layout.fillWidth: true
26 Layout.minimumWidth: implicitWidth
31 spacing: ScreenTools.defaultFontPixelWidth * 2
34 Layout.preferredWidth: height
35 height: valueLabel.height * 1.5
40 if (root.fact.value > root.fact.min) {
41 root.fact.value = root.fact.value - root.step
48 width: ScreenTools.defaultFontPixelWidth * 6
49 text: root.fact.valueString
53 Layout.preferredWidth: height
54 height: valueLabel.height * 1.5
59 if (root.fact.value < root.fact.max) {
60 root.fact.value = root.fact.value + root.step