5import QGroundControl.Controls
7// Important Note: Toolbar buttons must manage their checked state manually in order to support
8// view switch prevention. This means they can't be checkable or autoExclusive.
12 height: ScreenTools.defaultFontPixelHeight * 3
13 leftPadding: _horizontalMargin
14 rightPadding: _horizontalMargin
17 property bool logo: false
19 property real _horizontalMargin: ScreenTools.defaultFontPixelWidth
21 onCheckedChanged: checkable = false
23 background: Rectangle {
25 color: button.checked ? qgcPal.buttonHighlight : Qt.rgba(0,0,0,0)
27 border.width: QGroundControl.corePlugin.showTouchAreas ? 3 : 0
31 spacing: ScreenTools.defaultFontPixelWidth
32 anchors.verticalCenter: button.verticalCenter
35 height: ScreenTools.defaultFontPixelHeight * 2
37 sourceSize.height: parent.height
38 fillMode: Image.PreserveAspectFit
39 color: logo ? "transparent" : (button.checked ? qgcPal.buttonHighlightText : qgcPal.buttonText)
40 source: button.icon.source
41 anchors.verticalCenter: parent.verticalCenter
47 color: button.checked ? qgcPal.buttonHighlightText : qgcPal.buttonText
48 anchors.verticalCenter: parent.verticalCenter