diff --git a/src/QmlControls/IndicatorButton.qml b/src/QmlControls/IndicatorButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..f54b7bd0a79d52f221aaed8f471fabdc6941e9bf --- /dev/null +++ b/src/QmlControls/IndicatorButton.qml @@ -0,0 +1,24 @@ +import QtQuick 2.2 +import QtQuick.Controls 1.2 + +import QGroundControl.Controls 1.0 +import QGroundControl.Palette 1.0 + +// An IndicatorButton works just like q QGCButton with the additional support or a red/green +// indicator on the right edge. + +QGCButton { + property bool indicatorGreen: false + + Rectangle { + readonly property real indicatorRadius: 4 + + x: parent.width - (indicatorRadius * 2) - 5 + y: (parent.height - (indicatorRadius * 2)) / 2 + width: indicatorRadius * 2 + height: indicatorRadius * 2 + + radius: indicatorRadius + color: indicatorGreen ? "#00d932" : "red" + } +} diff --git a/src/QmlControls/qmldir b/src/QmlControls/qmldir index 2cde65c1b63f9e733d986b044ec7bb418b8fe4a8..e8044b4d53567ba87ffa028a890dd7028a0dc6e9 100644 --- a/src/QmlControls/qmldir +++ b/src/QmlControls/qmldir @@ -1,5 +1,5 @@ Module QGroundControl.Controls -SubMenuButton 1.0 SubMenuButton.qml + QGCLabel 1.0 QGCLabel.qml QGCButton 1.0 QGCButton.qml QGCRadioButton 1.0 QGCRadioButton.qml @@ -7,3 +7,7 @@ QGCCheckBox 1.0 QGCCheckBox.qml QGCTextField 1.0 QGCTextField.qml QGCComboBox 1.0 QGCComboBox.qml QGCColoredImage 1.0 QGCColoredImage.qml + +SubMenuButton 1.0 SubMenuButton.qml +IndicatorButton 1.0 IndicatorButton.qml +