MissionItemIndexLabel.qml 1.03 KB
Newer Older
1 2 3 4 5
import QtQuick                  2.2
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

12 13
    signal clicked

14 15
    readonly property real _margin: ScreenTools.defaultFontPixelWidth / 4

16 17
    QGCPalette { id: qgcPal }

18 19 20 21
    width:          _label.width + (_margin * 2)
    height:         _label.height +  (_margin * 2)
    radius:         _margin
    border.width:   1
22
    border.color:   "white"
23
    color:          isCurrentItem ? "green" : qgcPal.mapButtonHighlight
24

25
    MouseArea {
26 27
        anchors.fill:   parent
        onClicked:      parent.clicked()
28 29
    }

30
    QGCLabel {
Don Gagne's avatar
Don Gagne committed
31
        id:                     _label
32 33 34
        anchors.margins:        _margin
        anchors.left:           parent.left
        anchors.top:            parent.top
35
        color:                  "white"
36
        font.pixelSize:         ScreenTools.defaultFontPixelSize
37 38
    }
}