QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
SettingsButton.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Layouts
4
5import QGroundControl
6import QGroundControl.Controls
7
8Button {
9 id: control
10 padding: ScreenTools.defaultFontPixelWidth * 0.75
11 hoverEnabled: !ScreenTools.isMobile
12 autoExclusive: true
13 icon.color: textColor
14
15 property color textColor: checked || pressed ? qgcPal.buttonHighlightText : qgcPal.buttonText
16
17 QGCPalette {
18 id: qgcPal
19 colorGroupEnabled: control.enabled
20 }
21
22 background: Rectangle {
23 color: qgcPal.buttonHighlight
24 opacity: checked || pressed ? 1 : enabled && hovered ? .2 : 0
25 radius: ScreenTools.defaultFontPixelWidth / 2
26 }
27
28 contentItem: RowLayout {
29 spacing: ScreenTools.defaultFontPixelWidth
30
31 QGCColoredImage {
32 source: control.icon.source
33 color: control.icon.color
34 width: ScreenTools.defaultFontPixelHeight
35 height: ScreenTools.defaultFontPixelHeight
36 }
37
38 QGCLabel {
39 id: displayText
40 Layout.fillWidth: true
41 text: control.text
42 color: control.textColor
43 horizontalAlignment: QGCLabel.AlignLeft
44 }
45 }
46}