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
38 if (root.fact.value > root.fact.min) {
39 root.fact.value = root.fact.value - root.step
46 width: ScreenTools.defaultFontPixelWidth * 6
47 text: root.fact.valueString
51 Layout.preferredWidth: height
52 height: valueLabel.height * 1.5
55 if (root.fact.value < root.fact.max) {
56 root.fact.value = root.fact.value + root.step