IndicatorButton.qml 799 Bytes
Newer Older
1
import QtQuick          2.2
Don Gagne's avatar
Don Gagne committed
2 3
import QtQuick.Controls 1.2

4 5 6
import QGroundControl.Controls      1.0
import QGroundControl.Palette       1.0
import QGroundControl.ScreenTools   1.0
Don Gagne's avatar
Don Gagne committed
7 8 9 10 11

// An IndicatorButton works just like q QGCButton with the additional support or a red/green
// indicator on the right edge.

QGCButton {
12 13
    showBorder: true

Don Gagne's avatar
Don Gagne committed
14 15 16
    property bool indicatorGreen: false

    Rectangle {
17 18 19 20 21 22 23
        anchors.rightMargin:    ScreenTools.defaultFontPixelWidth / 3
        anchors.right:          parent.right
        anchors.verticalCenter: parent.verticalCenter
        width:                  radius * 2
        height:                 width
        radius:                 (ScreenTools.defaultFontPixelHeight * .75) / 2
        color:                  indicatorGreen ? "#00d932" : "red"
Don Gagne's avatar
Don Gagne committed
24 25
    }
}