6import QGroundControl.Controls
11 leftPadding: ScreenTools.defaultFontPixelWidth
12 rightPadding: leftPadding
14 property real _compIDWidth: ScreenTools.defaultFontPixelWidth * 3
15 property real _hzWidth: ScreenTools.defaultFontPixelWidth * 6
16 property real _nameWidth: nameLabel.contentWidth
18 background: Rectangle {
20 color: checked ? qgcPal.buttonHighlight : qgcPal.button
23 property double messageHz: 0
24 property int compID: 0
26 contentItem: RowLayout {
28 spacing: ScreenTools.defaultFontPixelWidth
32 color: checked ? qgcPal.buttonHighlightText : qgcPal.buttonText
33 verticalAlignment: Text.AlignVCenter
34 Layout.minimumHeight: ScreenTools.isMobile ? (ScreenTools.defaultFontPixelHeight * 2) : (ScreenTools.defaultFontPixelHeight * 1.5)
35 Layout.minimumWidth: _compIDWidth
40 color: checked ? qgcPal.buttonHighlightText : qgcPal.buttonText
41 Layout.fillWidth: true
42 Layout.alignment: Qt.AlignVCenter
45 color: checked ? qgcPal.buttonHighlightText : qgcPal.buttonText
46 text: messageHz.toFixed(1) + 'Hz'
47 horizontalAlignment: Text.AlignRight
48 Layout.minimumWidth: _hzWidth
49 Layout.alignment: Qt.AlignVCenter
53 Component.onCompleted: maxButtonWidth = Math.max(maxButtonWidth, _compIDWidth + _hzWidth + _nameWidth + (rowLayout.spacing * 2) + (control.leftPadding * 2))