|
|
|
@ -18,6 +18,12 @@ Button {
@@ -18,6 +18,12 @@ Button {
|
|
|
|
|
id: control |
|
|
|
|
height: ScreenTools.defaultFontPixelHeight * 2 |
|
|
|
|
autoExclusive: true |
|
|
|
|
leftPadding: ScreenTools.defaultFontPixelWidth |
|
|
|
|
rightPadding: leftPadding |
|
|
|
|
|
|
|
|
|
property real _compIDWidth: ScreenTools.defaultFontPixelWidth * 3 |
|
|
|
|
property real _hzWidth: ScreenTools.defaultFontPixelWidth * 7 |
|
|
|
|
property real _nameWidth: nameLabel.contentWidth |
|
|
|
|
|
|
|
|
|
background: Rectangle { |
|
|
|
|
anchors.fill: parent |
|
|
|
@ -28,20 +34,27 @@ Button {
@@ -28,20 +34,27 @@ Button {
|
|
|
|
|
property int compID: 0 |
|
|
|
|
|
|
|
|
|
contentItem: RowLayout { |
|
|
|
|
id: rowLayout |
|
|
|
|
spacing: ScreenTools.defaultFontPixelWidth |
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
|
text: control.compID |
|
|
|
|
color: checked ? qgcPal.buttonHighlightText : qgcPal.buttonText |
|
|
|
|
Layout.minimumWidth: ScreenTools.defaultFontPixelWidth * 3 |
|
|
|
|
Layout.minimumWidth: _compIDWidth |
|
|
|
|
} |
|
|
|
|
QGCLabel { |
|
|
|
|
id: nameLabel |
|
|
|
|
text: control.text |
|
|
|
|
color: checked ? qgcPal.buttonHighlightText : qgcPal.buttonText |
|
|
|
|
Layout.minimumWidth: ScreenTools.defaultFontPixelWidth * 28 |
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
} |
|
|
|
|
QGCLabel { |
|
|
|
|
color: checked ? qgcPal.buttonHighlightText : qgcPal.buttonText |
|
|
|
|
text: messageHz.toFixed(1) + 'Hz' |
|
|
|
|
Layout.alignment: Qt.AlignRight |
|
|
|
|
horizontalAlignment: Text.AlignRight |
|
|
|
|
Layout.minimumWidth: _hzWidth |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Component.onCompleted: maxButtonWidth = Math.max(maxButtonWidth, _compIDWidth + _hzWidth + _nameWidth + (rowLayout.spacing * 2) + (control.leftPadding * 2)) |
|
|
|
|
} |
|
|
|
|