Commit 98f7557b authored by Don Gagne's avatar Don Gagne

Redesigned setup buttons to save space

parent c33a4a83
...@@ -14,7 +14,7 @@ Button { ...@@ -14,7 +14,7 @@ Button {
text: "Button" ///< Pass in your own button text text: "Button" ///< Pass in your own button text
checkable: true checkable: true
height: ScreenTools.defaultFontPixelHeight * 5 height: ScreenTools.defaultFontPixelHeight * 2.5
style: ButtonStyle { style: ButtonStyle {
id: buttonStyle id: buttonStyle
...@@ -30,44 +30,27 @@ Button { ...@@ -30,44 +30,27 @@ Button {
id: innerRect id: innerRect
color: showHighlight ? qgcPal.buttonHighlight : qgcPal.windowShade color: showHighlight ? qgcPal.buttonHighlight : qgcPal.windowShade
readonly property real titleHeight: ScreenTools.defaultFontPixelHeight * 1.5 QGCColoredImage {
id: image
anchors.leftMargin: ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
width: ScreenTools.defaultFontPixelHeight * 2
height: ScreenTools.defaultFontPixelHeight * 2
fillMode: Image.PreserveAspectFit
smooth: true
color: control.setupComplete ? qgcPal.button : "red"
source: control.imageResource
}
QGCLabel { QGCLabel {
id: titleBar id: titleBar
width: parent.width anchors.leftMargin: ScreenTools.defaultFontPixelWidth
height: parent.titleHeight anchors.left: image.right
anchors.verticalCenter: parent.verticalCenter
verticalAlignment: TextEdit.AlignVCenter verticalAlignment: TextEdit.AlignVCenter
horizontalAlignment: TextEdit.AlignHCenter
color: showHighlight ? qgcPal.buttonHighlightText : qgcPal.buttonText color: showHighlight ? qgcPal.buttonHighlightText : qgcPal.buttonText
font.pixelSize: ScreenTools.isMobile ? ScreenTools.defaultFontPixelSize * 0.75 : ScreenTools.defaultFontPixelSize
text: control.text text: control.text
Rectangle {
anchors.rightMargin: ScreenTools.defaultFontPixelWidth / 3
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
width: ScreenTools.defaultFontPixelWidth
height: width
radius: width / 2
color: control.setupComplete ? "#00d932" : "red"
visible: control.setupIndicator
}
}
Rectangle {
anchors.top: titleBar.bottom
anchors.bottom: parent.bottom
width: parent.width
color: qgcPal.windowShadeDark
QGCColoredImage {
anchors.margins: ScreenTools.defaultFontPixelHeight * .75
anchors.fill: parent
fillMode: Image.PreserveAspectFit
smooth: true
color: showHighlight ? qgcPal.buttonHighlight : qgcPal.button
source: control.imageResource
}
} }
} }
......
...@@ -46,7 +46,7 @@ Rectangle { ...@@ -46,7 +46,7 @@ Rectangle {
readonly property real _defaultTextHeight: ScreenTools.defaultFontPixelHeight readonly property real _defaultTextHeight: ScreenTools.defaultFontPixelHeight
readonly property real _defaultTextWidth: ScreenTools.defaultFontPixelWidth readonly property real _defaultTextWidth: ScreenTools.defaultFontPixelWidth
readonly property real _margin: _defaultTextHeight / 2 readonly property real _margin: _defaultTextHeight / 2
readonly property real _buttonWidth: _defaultTextWidth * 17 readonly property real _buttonWidth: _defaultTextWidth * 18
readonly property string _armedVehicleText: "This operation cannot be performed while vehicle is armed." readonly property string _armedVehicleText: "This operation cannot be performed while vehicle is armed."
property string _messagePanelText: "missing message panel text" property string _messagePanelText: "missing message panel text"
...@@ -235,7 +235,7 @@ Rectangle { ...@@ -235,7 +235,7 @@ Rectangle {
setupIndicator: false setupIndicator: false
checked: true checked: true
exclusiveGroup: setupButtonGroup exclusiveGroup: setupButtonGroup
text: "SUMMARY" text: "Summary"
onClicked: showSummaryPanel() onClicked: showSummaryPanel()
} }
...@@ -247,7 +247,7 @@ Rectangle { ...@@ -247,7 +247,7 @@ Rectangle {
setupIndicator: false setupIndicator: false
exclusiveGroup: setupButtonGroup exclusiveGroup: setupButtonGroup
visible: !ScreenTools.isMobile visible: !ScreenTools.isMobile
text: "FIRMWARE" text: "Firmware"
onClicked: showFirmwarePanel() onClicked: showFirmwarePanel()
} }
...@@ -258,7 +258,7 @@ Rectangle { ...@@ -258,7 +258,7 @@ Rectangle {
exclusiveGroup: setupButtonGroup exclusiveGroup: setupButtonGroup
visible: _fullParameterVehicleAvailable visible: _fullParameterVehicleAvailable
setupIndicator: false setupIndicator: false
text: "PX4FLOW" text: "PX4Flow"
onClicked: showPX4FlowPanel() onClicked: showPX4FlowPanel()
} }
...@@ -269,7 +269,7 @@ Rectangle { ...@@ -269,7 +269,7 @@ Rectangle {
setupComplete: joystickManager.activeJoystick ? joystickManager.activeJoystick.calibrated : false setupComplete: joystickManager.activeJoystick ? joystickManager.activeJoystick.calibrated : false
exclusiveGroup: setupButtonGroup exclusiveGroup: setupButtonGroup
visible: _fullParameterVehicleAvailable && joystickManager.joysticks.length != 0 visible: _fullParameterVehicleAvailable && joystickManager.joysticks.length != 0
text: "JOYSTICK" text: "Joystick"
onClicked: showJoystickPanel() onClicked: showJoystickPanel()
} }
...@@ -283,7 +283,7 @@ Rectangle { ...@@ -283,7 +283,7 @@ Rectangle {
setupIndicator: modelData.requiresSetup setupIndicator: modelData.requiresSetup
setupComplete: modelData.setupComplete setupComplete: modelData.setupComplete
exclusiveGroup: setupButtonGroup exclusiveGroup: setupButtonGroup
text: modelData.name.toUpperCase() text: modelData.name
onClicked: showVehicleComponentPanel(modelData) onClicked: showVehicleComponentPanel(modelData)
} }
...@@ -294,7 +294,7 @@ Rectangle { ...@@ -294,7 +294,7 @@ Rectangle {
setupIndicator: false setupIndicator: false
exclusiveGroup: setupButtonGroup exclusiveGroup: setupButtonGroup
visible: multiVehicleManager.parameterReadyVehicleAvailable visible: multiVehicleManager.parameterReadyVehicleAvailable
text: "PARAMETERS" text: "Parameters"
onClicked: showParametersPanel() onClicked: showParametersPanel()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment