MissionItemIndexLabel.qml 1.16 KB
Newer Older
1
import QtQuick                  2.5
2 3 4 5
import QtQuick.Controls         1.2
import QtQuick.Controls.Styles  1.2

import QGroundControl.ScreenTools 1.0
6
import QGroundControl.Palette     1.0
7 8

Rectangle {
9 10 11 12 13
    id: root

    property alias  label:      _label.text
    property bool   checked:    false
    property bool   small:      false
14

15 16
    signal clicked

17 18 19 20
    width:          _width
    height:         _width
    radius:         _width / 2
    border.width:   small ? 1 : 2
21
    border.color:   "white"
22
    color:          checked ? "green" : qgcPal.mapButtonHighlight
23

24
    property real _width: small ? ScreenTools.defaultFontPixelHeight * ScreenTools.smallFontPointRatio * 1.75 : ScreenTools.defaultFontPixelHeight * 1.75
25 26 27

    QGCPalette { id: qgcPal }

28
    QGCLabel {
Don Gagne's avatar
Don Gagne committed
29
        id:                     _label
30 31 32
        anchors.fill:           parent
        horizontalAlignment:    Text.AlignHCenter
        verticalAlignment:      Text.AlignVCenter
33
        color:                  "white"
34
        font.pointSize:         small ? ScreenTools.smallFontPointSize : ScreenTools.defaultFontPointSize
35
    }
36 37 38 39 40 41

    MouseArea {
        anchors.fill: parent
        onClicked: parent.clicked()
    }

42
}