6import QGroundControl.Controls
13 property int _sliderInset: 2
14 property bool _showHighlight: enabled && (pressed || checked)
15 property real _labelSpacing: ScreenTools.defaultFontPixelWidth
17 QGCPalette { id: qgcPal; colorGroupEnabled: control.enabled }
19 // The label wraps only when the control is narrower than its single-line width
21 implicitWidth: (label.visible ? label.implicitWidth + control._labelSpacing : 0) + indicator.width
22 implicitHeight: label.contentHeight
26 objectName: "checkBoxSlider_label"
27 anchors.left: parent.left
28 width: Math.max(0, parent.width - indicator.width - control._labelSpacing)
29 text: visible ? control.text : "X"
30 wrapMode: Text.WordWrap
31 visible: control.text !== ""
36 objectName: "checkBoxSlider_indicator"
37 anchors.right: parent.right
38 anchors.verticalCenter: parent.verticalCenter
39 height: ScreenTools.defaultFontPixelHeight
42 color: checked ? qgcPal.accent : qgcPal.windowInset
44 border.color: checked ? qgcPal.accent : qgcPal.borderSubtle
49 opacity: _showHighlight ? 1 : control.enabled && control.hovered ? .2 : 0
54 anchors.verticalCenter: parent.verticalCenter
55 x: checked ? indicator.width - width - _sliderInset : _sliderInset
56 height: parent.height - (_sliderInset * 2)
59 color: qgcPal.textPrimary