QGCCheckBox.qml 1.13 KB
Newer Older
Don Gagne's avatar
Don Gagne committed
1 2 3 4 5
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2

import QGroundControl.Palette 1.0
6
import QGroundControl.ScreenTools 1.0
Don Gagne's avatar
Don Gagne committed
7 8

CheckBox {
9
    property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
Don Gagne's avatar
Don Gagne committed
10 11 12 13

    style: CheckBoxStyle {
        label: Item {
            implicitWidth: text.implicitWidth + 2
Don Gagne's avatar
Don Gagne committed
14
            implicitHeight: text.implicitHeight
Don Gagne's avatar
Don Gagne committed
15 16 17 18 19 20 21 22 23 24 25 26 27 28
            baselineOffset: text.baselineOffset
            Rectangle {
                anchors.fill: text
                anchors.margins: -1
                anchors.leftMargin: -3
                anchors.rightMargin: -3
                visible: control.activeFocus
                height: 6
                radius: 3
                color: "#224f9fef"
                border.color: "#47b"
                opacity: 0.6
            }
            Text {
29 30
                id:             text
                text:           control.text
31
                antialiasing:   true
Don Gagne's avatar
Don Gagne committed
32
                font.pixelSize: ScreenTools.defaultFontPixelSize
dogmaphobic's avatar
dogmaphobic committed
33
                anchors.verticalCenter: parent.verticalCenter
34
                color: control.__qgcPal.text
Don Gagne's avatar
Don Gagne committed
35 36 37 38
            }
        }
    }
}