MissionItemIndexLabel.qml 1.12 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 23 24 25
    property real _width: small ? ScreenTools.smallFontPixelSize * 1.5 : ScreenTools.mediumFontPixelSize * 1.5

    QGCPalette { id: qgcPal }

26
    MouseArea {
27 28 29
        anchors.fill: parent

        onClicked: parent.clicked()
30 31
    }

32
    QGCLabel {
Don Gagne's avatar
Don Gagne committed
33
        id:                     _label
34 35 36
        anchors.fill:           parent
        horizontalAlignment:    Text.AlignHCenter
        verticalAlignment:      Text.AlignVCenter
37
        color:                  "white"
38
        font.pixelSize:         small ? ScreenTools.smallFontPixelSize : ScreenTools.mediumFontPixelSize
39 40
    }
}