From 3a00fdadc8638ef5307ede05b66fa2028e27f7e6 Mon Sep 17 00:00:00 2001 From: Jacob Dahl Date: Thu, 13 Feb 2020 13:48:36 -0700 Subject: [PATCH] Added properties to enable changing the color of the checklist section headers based on the pass/fail status of the checklist items --- src/QmlControls/PreFlightCheckButton.qml | 1 + src/QmlControls/PreFlightCheckGroup.qml | 8 ++++++++ src/QmlControls/SectionHeader.qml | 1 + 3 files changed, 10 insertions(+) diff --git a/src/QmlControls/PreFlightCheckButton.qml b/src/QmlControls/PreFlightCheckButton.qml index 7f87bebbd..6692a0f3a 100644 --- a/src/QmlControls/PreFlightCheckButton.qml +++ b/src/QmlControls/PreFlightCheckButton.qml @@ -32,6 +32,7 @@ QGCButton { property bool telemetryFailure: false ///< true: telemetry check failing, false: telemetry check passing property bool allowTelemetryFailureOverride: false ///< true: user can click past telemetry failure property bool passed: _manualState === _statePassed && _telemetryState === _statePassed + property bool failed: _manualState === _stateFailed || _telemetryState === _stateFailed property int _manualState: manualText === "" ? _statePassed : _statePending property int _telemetryState: _statePassed diff --git a/src/QmlControls/PreFlightCheckGroup.qml b/src/QmlControls/PreFlightCheckGroup.qml index 97a40a400..4e1a0f7b3 100644 --- a/src/QmlControls/PreFlightCheckGroup.qml +++ b/src/QmlControls/PreFlightCheckGroup.qml @@ -16,7 +16,12 @@ import QGroundControl.ScreenTools 1.0 /// A PreFlightCheckGroup manages a set of PreFlightCheckButtons as a single entity. Column { property string name + property string passedTextColor: "black" + property string failedTextColor: "black" + property string pendingTextColor: "black" + property bool passed: false + property bool failed: false spacing: ScreenTools.defaultFontPixelHeight / 2 @@ -47,6 +52,7 @@ Column { anchors.left: parent.left anchors.right: parent.right text: name + (passed ? qsTr(" (passed)") : "") + color: failed ? failedTextColor : (passed ? passedTextColor : pendingTextColor) } Column { @@ -58,9 +64,11 @@ Column { for (var i=0; i