6import QGroundControl.Controls
9 id: control //This is a button rework from DonLakeFlyer's QGCButton that allows to contain a text and an Icon with a column look and the same capabilites
11 background: Rectangle {
14 height: control.height
16 border.width: showBorder ? 1 : 0
17 border.color: qgcPal.buttonText
18 color: _showHighlight ?
19 qgcPal.buttonHighlight :
20 (primary ? qgcPal.primaryButton : qgcPal.button)
25 implicitWidth: Math.max(textLabel.implicitWidth , icon.implicitWidth ) * 1.1
26 implicitHeight: iconSource === "" ? textLabel.implicitHeight : textLabel.implicitHeight * 2.5
31 Layout.fillWidth: true
32 Layout.fillHeight: true
33 Layout.maximumHeight: parent.height - textLabelContainer.height
34 Layout.alignment: control.text !== "" ? Qt.AlignTop : Qt.AlignHCenter | Qt.AlignVCenter
35 source: control.iconSource
37 fillMode: Image.PreserveAspectFit
38 sourceSize.height: height
39 sourceSize.width: width
40 visible: control.iconSource !== "" ? true : false
44 id: textLabelContainer
45 Layout.alignment: icon.visible ? Qt.AlignBottom | Qt.AlignHCenter : Qt.AlignCenter
46 visible: control.text !== "" ? true : false
47 Layout.preferredWidth: parent.width
48 Layout.preferredHeight: textLabel.baselineOffset
52 font.family: control.font.family
53 font.pointSize: control.font.pointSize
54 color: _showHighlight ? qgcPal.buttonHighlightText : (primary ? qgcPal.primaryButtonText : qgcPal.buttonText)
55 anchors.baseline: iconSource !== "" ? parent.bottom : undefined
56 anchors.centerIn: iconSource === "" ? parent : undefined
57 anchors.horizontalCenter: parent.horizontalCenter