Newer
Older
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
property alias source: icon.source
property bool checked: false
property bool logo: false
readonly property real _topBottomMargins: ScreenTools.defaultFontPixelHeight / 2
onExclusiveGroupChanged: {
if (exclusiveGroup) {
exclusiveGroup.bindCheckable(_root)
}
}
QGCPalette { id: qgcPal }
Rectangle {
anchors.fill: parent
visible: logo
color: "#4A2C6D"
}
QGCColoredImage {
id: icon
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: _topBottomMargins
anchors.top: parent.top
anchors.bottomMargin: _topBottomMargins
anchors.bottom: parent.bottom
color: logo ? "white" : (checked ? qgcPal.buttonHighlight : qgcPal.buttonText)
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
color: qgcPal.buttonHighlight
visible: checked