MissionItemIndexLabel.qml 1.17 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 {
Don Gagne's avatar
Don Gagne committed
9 10
    property alias  label:          _label.text
    property bool   isCurrentItem:  false
11
    property bool   small:          false
12

13 14
    signal clicked

15 16 17 18
    width:          _width
    height:         _width
    radius:         _width / 2
    border.width:   small ? 1 : 2
19
    border.color:   "white"
20
    color:          isCurrentItem ? "green" : qgcPal.mapButtonHighlight
21

22
    property real _width: small ? ScreenTools.defaultFontPixelHeight * ScreenTools.smallFontPointRatio * 1.75 : ScreenTools.defaultFontPixelHeight * 1.75
23 24 25

    QGCPalette { id: qgcPal }

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

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

40
}