From fc01014c184861c7eba568d0bcf6b9957160511c Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Tue, 17 Feb 2015 18:36:38 -0800 Subject: [PATCH] Modify UI to fit latest designer sketches --- qgroundcontrol.qrc | 6 + src/AutoPilotPlugins/PX4/AirframeComponent.cc | 4 +- src/AutoPilotPlugins/PX4/AirframeComponent.h | 2 +- .../PX4/AirframeComponentIcon.png | Bin 0 -> 503 bytes .../PX4/AirframeComponentSummary.qml | 11 +- .../PX4/FlightModesComponent.cc | 4 +- .../PX4/FlightModesComponent.h | 2 +- .../PX4/FlightModesComponentIcon.png | Bin 0 -> 460 bytes .../PX4/FlightModesComponentSummary.qml | 19 +-- src/AutoPilotPlugins/PX4/RadioComponent.cc | 4 +- src/AutoPilotPlugins/PX4/RadioComponent.h | 2 +- .../PX4/RadioComponentIcon.png | Bin 0 -> 728 bytes .../PX4/RadioComponentSummary.qml | 23 ++-- src/AutoPilotPlugins/PX4/SafetyComponent.cc | 5 +- src/AutoPilotPlugins/PX4/SafetyComponent.h | 2 +- .../PX4/SafetyComponentSummary.qml | 25 ++-- src/AutoPilotPlugins/PX4/SensorsComponent.cc | 4 +- src/AutoPilotPlugins/PX4/SensorsComponent.h | 2 +- .../PX4/SensorsComponentIcon.png | Bin 0 -> 726 bytes .../PX4/SensorsComponentSummary.qml | 19 +-- src/QGCPalette.cc | 14 ++- src/QGCPalette.h | 12 ++ src/QmlControls/QGCButton.qml | 2 +- src/QmlControls/QmlTest.qml | 40 ++++++ src/QmlControls/SetupButton.qml | 19 ++- src/VehicleSetup/FirmwareUpgrade.qml | 3 +- src/VehicleSetup/FirmwareUpgradeIcon.png | Bin 0 -> 418 bytes src/VehicleSetup/SetupView.ui | 12 ++ src/VehicleSetup/SetupViewButtons.qml | 8 +- src/VehicleSetup/VehicleComponent.h | 4 +- src/VehicleSetup/VehicleSummary.qml | 118 ++++++++---------- src/VehicleSetup/VehicleSummaryIcon.png | Bin 0 -> 502 bytes 32 files changed, 215 insertions(+), 151 deletions(-) create mode 100644 src/AutoPilotPlugins/PX4/AirframeComponentIcon.png create mode 100644 src/AutoPilotPlugins/PX4/FlightModesComponentIcon.png create mode 100644 src/AutoPilotPlugins/PX4/RadioComponentIcon.png create mode 100644 src/AutoPilotPlugins/PX4/SensorsComponentIcon.png create mode 100644 src/VehicleSetup/FirmwareUpgradeIcon.png create mode 100644 src/VehicleSetup/VehicleSummaryIcon.png diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index aa035643d..f3ce0e7f4 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -269,6 +269,12 @@ src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml files/Setup/cogwheels.png + src/AutoPilotPlugins/PX4/SensorsComponentIcon.png + src/AutoPilotPlugins/PX4/RadioComponentIcon.png + src/AutoPilotPlugins/PX4/FlightModesComponentIcon.png + src/AutoPilotPlugins/PX4/AirframeComponentIcon.png + src/VehicleSetup/FirmwareUpgradeIcon.png + src/VehicleSetup/VehicleSummaryIcon.png diff --git a/src/AutoPilotPlugins/PX4/AirframeComponent.cc b/src/AutoPilotPlugins/PX4/AirframeComponent.cc index 120304bd1..223765f99 100644 --- a/src/AutoPilotPlugins/PX4/AirframeComponent.cc +++ b/src/AutoPilotPlugins/PX4/AirframeComponent.cc @@ -133,9 +133,9 @@ QString AirframeComponent::description(void) const "This will in turn set up the various tuning values for flight paramters."); } -QString AirframeComponent::icon(void) const +QString AirframeComponent::iconResource(void) const { - return ":/files/images/px4/menu/plane.png"; + return "AirframeComponentIcon.png"; } bool AirframeComponent::requiresSetup(void) const diff --git a/src/AutoPilotPlugins/PX4/AirframeComponent.h b/src/AutoPilotPlugins/PX4/AirframeComponent.h index 98b04484a..1b5247491 100644 --- a/src/AutoPilotPlugins/PX4/AirframeComponent.h +++ b/src/AutoPilotPlugins/PX4/AirframeComponent.h @@ -43,7 +43,7 @@ public: // Virtuals from VehicleComponent virtual QString name(void) const; virtual QString description(void) const; - virtual QString icon(void) const; + virtual QString iconResource(void) const; virtual bool requiresSetup(void) const; virtual bool setupComplete(void) const; virtual QString setupStateDescription(void) const; diff --git a/src/AutoPilotPlugins/PX4/AirframeComponentIcon.png b/src/AutoPilotPlugins/PX4/AirframeComponentIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce4b4c3710b0d906d7a02ae92653f0828ad33b56 GIT binary patch literal 503 zcmV{yMBgCGg(PyH+hYiLt%q(8m<#oLLqmCnrLhtKBOtWW(Y#l}1n?X}B3b8rCdYBSo_rGY&^E zjsU6YE?bfP+-jl1La8Yf*XCw)6`nZ>CB zCu)bv`{={2f7#R6ZjrXL%7{(c(w>NvT)w3xiise0DC5XTs!|CD8QY+w`Y(u=*2mUb t+Q+|aX|>OvIa=C!g6+l{`~Fve0RRbZ2k6l?ri}mq002ovPDHLkV1lEp)B6Ab literal 0 HcmV?d00001 diff --git a/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml b/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml index 352151fa0..991e60bcf 100644 --- a/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml @@ -1,8 +1,9 @@ import QtQuick 2.2 import QtQuick.Controls 1.2 import QtQuick.Controls.Styles 1.2 + import QGroundControl.FactSystem 1.0 -import QGroundControl.FactControls 1.0 +import QGroundControl.Controls 1.0 Column { anchors.fill: parent @@ -11,8 +12,8 @@ Column { Row { width: parent.width - Text { id: systemId; text: "System ID:" } - Text { + QGCLabel { id: systemId; text: "System ID:" } + QGCLabel { horizontalAlignment: Text.AlignRight width: parent.width - systemId.contentWidth text: autopilot.parameters["MAV_SYS_ID"].value @@ -22,8 +23,8 @@ Column { Row { width: parent.width - Text { id: airframe; text: "Airframe:" } - Text { + QGCLabel { id: airframe; text: "Airframe:" } + QGCLabel { horizontalAlignment: Text.AlignRight width: parent.width - airframe.contentWidth text: autopilot.parameters["SYS_AUTOSTART"].value == 0 ? "Setup required" : autopilot.parameters["SYS_AUTOSTART"].value diff --git a/src/AutoPilotPlugins/PX4/FlightModesComponent.cc b/src/AutoPilotPlugins/PX4/FlightModesComponent.cc index 525247831..629295295 100644 --- a/src/AutoPilotPlugins/PX4/FlightModesComponent.cc +++ b/src/AutoPilotPlugins/PX4/FlightModesComponent.cc @@ -63,9 +63,9 @@ QString FlightModesComponent::description(void) const "At a minimum the Main Mode Switch must be assigned prior to flight."); } -QString FlightModesComponent::icon(void) const +QString FlightModesComponent::iconResource(void) const { - return ":/files/images/px4/menu/toggle_switch.png"; + return "FlightModesComponentIcon.png"; } bool FlightModesComponent::requiresSetup(void) const diff --git a/src/AutoPilotPlugins/PX4/FlightModesComponent.h b/src/AutoPilotPlugins/PX4/FlightModesComponent.h index 74c0a37b3..da97c5565 100644 --- a/src/AutoPilotPlugins/PX4/FlightModesComponent.h +++ b/src/AutoPilotPlugins/PX4/FlightModesComponent.h @@ -43,7 +43,7 @@ public: // Virtuals from VehicleComponent virtual QString name(void) const; virtual QString description(void) const; - virtual QString icon(void) const; + virtual QString iconResource(void) const; virtual bool requiresSetup(void) const; virtual bool setupComplete(void) const; virtual QString setupStateDescription(void) const; diff --git a/src/AutoPilotPlugins/PX4/FlightModesComponentIcon.png b/src/AutoPilotPlugins/PX4/FlightModesComponentIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..736c89627e521363218f816bfff27d6e375b86c7 GIT binary patch literal 460 zcmV;-0Wv00009a7bBm000XU z000XU0RWnu7ytkO8FWQhbW?9;ba!ELWdK2BZ(?O2No`?gWm08fWO;GPWjp`?0a-~z zK~#9!>{!u_gD?yY)%}+Zt|Mdwxb^^Ew(hazqAeTr%iXuCSLqA%{ zPqI*`d3_iw%5x(k7-KH>B7Hn;tWDFbf(Xyk*>Km@^E|{6I8qyAPg-X0=DK_5@#UckogGP8}BF{(>sgd4Mi5KXAeg=iO zTpJVgBSmDgQi#wY%IR{ILWFiD8c)Ez?`VCi+%WFZ`lp~^z5j|~$PXa*Pdo=Td*Z&g zhG{-!q!Y~X?xc)aAG)zD`LER0qK^cJ&U;;)+I{{?^(g~7IKsIQYfXYSOsUb=% zCA5U&-RaB)u=Hfves(+$vDabl^$gpmCJ@@k$h$(^34fo1mDujU(lf+#?DHNh0t>Kp zhEL0nJU<5hfo?+^q5J%|{g8_Si-#(s@YWZV?0Y?=Qe*sIf0Q*FusdM=e5;ou%huG9){t{q`t-;=b zWYIJtQ?Si`c*rpJph{-DA3naoW@sfdRVQ) zgH%y8jl#GkR!L@~x^lG#J|x_9P&67vVU#PAWE0*heHiVMo++HgihXLP@RM~>6p6r5 zaDHspv??w!B8VEdn_yZ!Xj-F z&c3ww%G(F^>z0PVOT0HP&~l0LSCJAZ?mZjKBsZ8?ZqcA>AOIfNnrHpq+qZf^-AY3CISn)pM?nVoSn& z?y5U3=h#S3UrQv3fV9?yc~mk30dL8)X1o#4FNBj=L}CWGZ`7J zm8D`q0%Z#TO|7h9V6BEgb+Qmy_iM2SAtv=7r3(U09k~^EICl;=Q)DZ8rxaQhD5nl~ z&cT9+-zFw3thd@w9NIE?qb{hebEp?2SsGbMv^7W;IMX{g4xBX`24piq(sVw{BKLQc z$+a(*th>pu7;wwosAW8RFAHh$P&=_A6J&TFG78H6d+(tawTJPUvVwCivr3iJMd8$G zZ_*$K*`SJzy_r{mktD z0>w;DX#IrNUuX^Wl)9f`ui}7E#sFik1+lNFx)`t|rkts}T;sEm0L?}SxU))(FH)zd`Aa4SY@60H3ky!M|#2u~zIC)+fYr)zrXd+U?4g^-*O+MU6^q7?hwj?b zD5w!26(b8@*)_GfXYS{61kjS{8}?Kmz`7%9Ql#D91oj&e2O8`&G1t`W@WoG>b)dUf z!KRt8YDoy($BZME|3MfQEvIoWac|^smkPt8XZa(o@?;@Gp;t;@s#x>S^Pz0`XCxyLDtj~5V;L25e$}&{E2q?Yu218l>hUAM0D^3{_mEs5{{R3007*qo IM6N<$g4+H+761SM literal 0 HcmV?d00001 diff --git a/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml b/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml index 25f237cbd..9c8311c99 100644 --- a/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml @@ -1,8 +1,9 @@ import QtQuick 2.2 import QtQuick.Controls 1.2 import QtQuick.Controls.Styles 1.2 + import QGroundControl.FactSystem 1.0 -import QGroundControl.FactControls 1.0 +import QGroundControl.Controls 1.0 Column { anchors.fill: parent @@ -11,8 +12,8 @@ Column { Row { width: parent.width - Text { id: compass; text: "Compass:" } - Text { + QGCLabel { id: compass; text: "Compass:" } + QGCLabel { horizontalAlignment: Text.AlignRight; width: parent.width - compass.contentWidth; property bool setupRequiredValue: autopilot.parameters["SENS_MAG_XOFF"] ? autopilot.parameters["SENS_MAG_XOFF"].value : autopilot.parameters["CAL_MAG0_ID"].value @@ -23,8 +24,8 @@ Column { Row { width: parent.width - Text { id: gyro; text: "Gyro:" } - Text { + QGCLabel { id: gyro; text: "Gyro:" } + QGCLabel { horizontalAlignment: Text.AlignRight; width: parent.width - gyro.contentWidth; property bool setupRequiredValue: autopilot.parameters["SENS_GYRO_XOFF"] ? autopilot.parameters["SENS_GYRO_XOFF"].value : autopilot.parameters["CAL_GYRO0_ID"].value @@ -35,8 +36,8 @@ Column { Row { width: parent.width - Text { id: accel; text: "Accelerometer:" } - Text { + QGCLabel { id: accel; text: "Accelerometer:" } + QGCLabel { horizontalAlignment: Text.AlignRight; width: parent.width - accel.contentWidth; property bool setupRequiredValue: autopilot.parameters["SENS_ACC_XOFF"] ? autopilot.parameters["SENS_ACC_XOFF"].value : autopilot.parameters["CAL_ACC0_ID"].value @@ -47,8 +48,8 @@ Column { Row { width: parent.width - Text { id: airspeed; text: "Airspeed:" } - Text { + QGCLabel { id: airspeed; text: "Airspeed:" } + QGCLabel { horizontalAlignment: Text.AlignRight; width: parent.width - airspeed.contentWidth; text: autopilot.parameters["SENS_DPRES_OFF"].value == 0.0 ? "Setup required" : "Ready" diff --git a/src/QGCPalette.cc b/src/QGCPalette.cc index 3ae331467..0cb8364c1 100644 --- a/src/QGCPalette.cc +++ b/src/QGCPalette.cc @@ -63,14 +63,24 @@ QColor QGCPalette::_window[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = { { QColor(0x22, 0x22, 0x22), QColor(0x22, 0x22, 0x22), QColor(0x22, 0x22, 0x22) } }; +QColor QGCPalette::_windowShade[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = { + { QColor(255, 235, 211), QColor(255, 235, 211), QColor(255, 235, 211) }, + { QColor(51, 51, 51), QColor(51, 51, 51), QColor(51, 51, 51) } +}; + +QColor QGCPalette::_windowShadeDark[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = { + { QColor(216, 216, 216), QColor(216, 216, 216), QColor(216, 216, 216) }, + { QColor(40, 40, 40), QColor(40, 40, 40), QColor(40, 40, 40) } +}; + QColor QGCPalette::_windowText[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = { { QColor(0x58, 0x58, 0x58), QColor(0, 0, 0), QColor(0, 0, 0) }, { QColor(0x58, 0x58, 0x58), QColor(0xFF, 0xFF, 0xFF), QColor(0xFF, 0xFF, 0xFF) } }; QColor QGCPalette::_buttonHighlight[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = { - { QColor(0x58, 0x58, 0x58), QColor(0xee, 0xe3, 0x33), QColor(0xee, 0xe3, 0x33) }, - { QColor(0x58, 0x58, 0x58), QColor(0xee, 0xe3, 0x33), QColor(0xee, 0xe3, 0x33) }, + { QColor(0x58, 0x58, 0x58), QColor(238, 227, 51), QColor(238, 227, 51) }, + { QColor(0x58, 0x58, 0x58), QColor(238, 227, 51), QColor(238, 227, 51) }, }; QGCPalette::QGCPalette(QObject* parent) : diff --git a/src/QGCPalette.h b/src/QGCPalette.h index 85b7e1427..dc22c8ebc 100644 --- a/src/QGCPalette.h +++ b/src/QGCPalette.h @@ -54,6 +54,14 @@ class QGCPalette : public QObject /// The buttonHighlight color identifies the button background color when hovered or selected. Q_PROPERTY(QColor buttonHighlight READ buttonHighlight NOTIFY paletteChanged) + /// The windowShade color should be a color somewhere between window and button. It is used to shade window + /// areas. + Q_PROPERTY(QColor windowShade READ windowShade NOTIFY paletteChanged) + + /// The windowShadeDark color should be a color somewhere between window and windowShade. It is used to shade window + /// darker areas. + Q_PROPERTY(QColor windowShadeDark READ windowShadeDark NOTIFY paletteChanged) + public: enum ColorGroup { Disabled = 0, @@ -78,6 +86,8 @@ public: QColor buttonText(void) const { return _buttonText[_theme][_colorGroup]; } QColor text(void) const { return _text[_theme][_colorGroup]; } QColor window(void) const { return _window[_theme][_colorGroup]; } + QColor windowShade(void) const { return _windowShade[_theme][_colorGroup]; } + QColor windowShadeDark(void) const { return _windowShadeDark[_theme][_colorGroup]; } QColor windowText(void) const { return _windowText[_theme][_colorGroup]; } QColor buttonHighlight(void) const { return _buttonHighlight[_theme][_colorGroup]; } @@ -100,6 +110,8 @@ private: static QColor _buttonText[_cThemes][_cColorGroups]; static QColor _text[_cThemes][_cColorGroups]; static QColor _window[_cThemes][_cColorGroups]; + static QColor _windowShade[_cThemes][_cColorGroups]; + static QColor _windowShadeDark[_cThemes][_cColorGroups]; static QColor _windowText[_cThemes][_cColorGroups]; static QColor _buttonHighlight[_cThemes][_cColorGroups]; diff --git a/src/QmlControls/QGCButton.qml b/src/QmlControls/QGCButton.qml index d60b06b0c..829612ba7 100644 --- a/src/QmlControls/QGCButton.qml +++ b/src/QmlControls/QGCButton.qml @@ -11,7 +11,7 @@ Button { background: Rectangle { implicitWidth: 100 implicitHeight: 25 - color: control.hovered ? control.__qgcPal.buttonHighlight : control.__qgcPal.button + color: control.pressed ? control.__qgcPal.buttonHighlight : control.__qgcPal.button } label: Text { diff --git a/src/QmlControls/QmlTest.qml b/src/QmlControls/QmlTest.qml index 627341bbb..3cdcfccf3 100644 --- a/src/QmlControls/QmlTest.qml +++ b/src/QmlControls/QmlTest.qml @@ -210,6 +210,46 @@ Rectangle { sourceComponent: colorSquare } + Loader { + sourceComponent: rowHeader + property var text: "windowShade" + } + Loader { + property var palette: QGCPalette { colorGroup: QGCPalette.Disabled } + property var color: palette.windowShade + sourceComponent: colorSquare + } + Loader { + property var palette: QGCPalette { colorGroup: QGCPalette.Active } + property var color: palette.windowShade + sourceComponent: colorSquare + } + Loader { + property var palette: QGCPalette { colorGroup: QGCPalette.Inactive } + property var color: palette.windowShade + sourceComponent: colorSquare + } + + Loader { + sourceComponent: rowHeader + property var text: "windowShadeDark" + } + Loader { + property var palette: QGCPalette { colorGroup: QGCPalette.Disabled } + property var color: palette.windowShadeDark + sourceComponent: colorSquare + } + Loader { + property var palette: QGCPalette { colorGroup: QGCPalette.Active } + property var color: palette.windowShadeDark + sourceComponent: colorSquare + } + Loader { + property var palette: QGCPalette { colorGroup: QGCPalette.Inactive } + property var color: palette.windowShadeDark + sourceComponent: colorSquare + } + Loader { sourceComponent: rowHeader property var text: "windowText" diff --git a/src/QmlControls/SetupButton.qml b/src/QmlControls/SetupButton.qml index ba2f03f1a..612b8430e 100644 --- a/src/QmlControls/SetupButton.qml +++ b/src/QmlControls/SetupButton.qml @@ -12,11 +12,12 @@ Button { text: "Button" property bool setupComplete: true property bool setupIndicator: true + property string imageResource: "setupButtonImage.png" style: ButtonStyle { id: buttonStyle - property var __qgcpal: QGCPalette { + property var __qgcPal: QGCPalette { colorGroup: control.enabled ? QGCPalette.Active : QGCPalette.Disabled } @@ -24,10 +25,7 @@ Button { id: innerRect readonly property real titleHeight: 20 - border.color: control.checked ? "#eee333" : "#676767" - radius: 10 - - color: control.checked ? "#eee333" : "#343434" + color: control.pressed ? __qgcPal.buttonHighlight : (control.checked ? __qgcPal.buttonHighlight : __qgcPal.button) Text { id: titleBar @@ -40,7 +38,7 @@ Button { text: control.text font.pixelSize: 12 - color: control.checked ? "black" : "white" + color: __qgcPal.buttonText Rectangle { id: setupIndicator @@ -53,7 +51,7 @@ Button { height: indicatorRadius * 2 radius: indicatorRadius - color: control.setupIndicator ? (control.setupComplete ? "green" : "red") : innerRect.color + color: control.setupIndicator ? (control.setupComplete ? "#00d932" : "red") : innerRect.color } } @@ -63,12 +61,11 @@ Button { y: parent.titleHeight - color: __qgcpal.window - border.color: control.checked ? "#eee333" : "#676767" + color: __qgcPal.windowShade Image { id: buttonImage - source: "setupButtonImage.png" + source: control.imageResource sourceSize: Qt.size(parent.width - 20, parent.height - 20) anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter @@ -79,7 +76,7 @@ Button { ColorOverlay { anchors.fill: buttonImage source: buttonImage - color: control.checked ? "#eee333" : "#58585a" + color: control.pressed ? __qgcPal.buttonHighlight : (control.checked ? __qgcPal.buttonHighlight : __qgcPal.button) } } } diff --git a/src/VehicleSetup/FirmwareUpgrade.qml b/src/VehicleSetup/FirmwareUpgrade.qml index 53f150cef..8545a450d 100644 --- a/src/VehicleSetup/FirmwareUpgrade.qml +++ b/src/VehicleSetup/FirmwareUpgrade.qml @@ -95,9 +95,10 @@ Rectangle { width: parent.width height: 300 readOnly: true + frameVisible: false style: TextAreaStyle { textColor: qgcPal.windowText - backgroundColor: qgcPal.window + backgroundColor: qgcPal.windowShade } } } diff --git a/src/VehicleSetup/FirmwareUpgradeIcon.png b/src/VehicleSetup/FirmwareUpgradeIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..2442f391a7a323bcfa25dccfcda7d56977164f34 GIT binary patch literal 418 zcmV;T0bTxyP)qa6ENEqhLvU3M4^i>N{v8EGeO28;z3gXAJZt!O);Mh$H{}v9YxuIZcn<*v0PJB<-lkf`IsgCw M07*qoM6N<$f>Nud7XSbN literal 0 HcmV?d00001 diff --git a/src/VehicleSetup/SetupView.ui b/src/VehicleSetup/SetupView.ui index ca38a2c36..aef9e3e41 100644 --- a/src/VehicleSetup/SetupView.ui +++ b/src/VehicleSetup/SetupView.ui @@ -14,6 +14,18 @@ Form + + 0 + + + 0 + + + 0 + + + 0 + diff --git a/src/VehicleSetup/SetupViewButtons.qml b/src/VehicleSetup/SetupViewButtons.qml index f1c492967..7faaad80c 100644 --- a/src/VehicleSetup/SetupViewButtons.qml +++ b/src/VehicleSetup/SetupViewButtons.qml @@ -21,12 +21,11 @@ Rectangle { Column { anchors.fill: parent - spacing: 10 - SetupButton { id: firmwareButton; objectName: "firmwareButton" width: parent.width text: "FIRMWARE" + imageResource: "FirmwareUpgradeIcon.png" setupIndicator: false exclusiveGroup: setupButtonGroup onClicked: controller.firmwareButtonClicked() @@ -40,12 +39,11 @@ Rectangle { Column { anchors.fill: parent - spacing: 10 - SetupButton { id: summaryButton; objectName: "summaryButton" width: parent.width text: "SUMMARY" + imageResource: "VehicleSummaryIcon.png" setupIndicator: false exclusiveGroup: setupButtonGroup onClicked: controller.summaryButtonClicked() @@ -55,6 +53,7 @@ Rectangle { id: firmwareButton; objectName: "firmwareButton" width: parent.width text: "FIRMWARE" + imageResource: "FirmwareUpgradeIcon.png" setupIndicator: false exclusiveGroup: setupButtonGroup onClicked: controller.firmwareButtonClicked() @@ -66,6 +65,7 @@ Rectangle { SetupButton { width: parent.width text: modelData.name.toUpperCase() + imageResource: modelData.iconResource setupComplete: modelData.setupComplete exclusiveGroup: setupButtonGroup onClicked: controller.setupButtonClicked(modelData) diff --git a/src/VehicleSetup/VehicleComponent.h b/src/VehicleSetup/VehicleComponent.h index 19fe8a596..397f3c6c8 100644 --- a/src/VehicleSetup/VehicleComponent.h +++ b/src/VehicleSetup/VehicleComponent.h @@ -47,7 +47,7 @@ class VehicleComponent : public QObject Q_PROPERTY(bool requiresSetup READ requiresSetup CONSTANT) Q_PROPERTY(bool setupComplete READ setupComplete STORED false NOTIFY setupCompleteChanged) Q_PROPERTY(QString setupStateDescription READ setupStateDescription STORED false) - Q_PROPERTY(QString icon READ icon CONSTANT) + Q_PROPERTY(QString iconResource READ iconResource CONSTANT) Q_PROPERTY(QWidget* setupWidget READ setupWidget STORED false) Q_PROPERTY(QUrl summaryQmlSource READ summaryQmlSource CONSTANT); Q_PROPERTY(QString prerequisiteSetup READ prerequisiteSetup) @@ -58,7 +58,7 @@ public: virtual QString name(void) const = 0; virtual QString description(void) const = 0; - virtual QString icon(void) const = 0; + virtual QString iconResource(void) const = 0; virtual bool requiresSetup(void) const = 0; virtual bool setupComplete(void) const = 0; virtual QString setupStateDescription(void) const = 0; diff --git a/src/VehicleSetup/VehicleSummary.qml b/src/VehicleSetup/VehicleSummary.qml index acc4d5da4..18a714486 100644 --- a/src/VehicleSetup/VehicleSummary.qml +++ b/src/VehicleSetup/VehicleSummary.qml @@ -9,101 +9,81 @@ Rectangle { width: 600 height: 400 - QGCPalette { id: palette; colorGroup: QGCPalette.Active } + property var qgcPal: QGCPalette { id: palette; colorGroup: QGCPalette.Active } id: topLevel objectName: "topLevel" - color: palette.window - Image { - anchors.fill: parent - fillMode: Image.PreserveAspectFit - smooth: true - source: autopilot.setupBackgroundImage; - } - Column { - anchors.margins: 20 - anchors.fill: parent - spacing: 5 + color: qgcPal.window - Flow { - width: parent.width; - height: parent.height - spacing: 5 - - Repeater { - model: autopilot.components + Flow { + anchors.fill: parent + spacing: 10 - Button { - width: 250 - height: 200 + Repeater { + model: autopilot.components - property var summaryQmlSource: modelData.summaryQmlSource - text: modelData.name - property bool setupComplete: modelData.setupComplete + Button { + width: 250 + height: 200 - style: ButtonStyle { - id: buttonStyle - background: Rectangle { - id: innerRect - readonly property real titleHeight: 30 + property var summaryQmlSource: modelData.summaryQmlSource + text: modelData.name + property bool setupComplete: modelData.setupComplete - border.color: "#888" - radius: 10 + style: ButtonStyle { + id: buttonStyle + background: Rectangle { + id: innerRect + readonly property real titleHeight: 30 - color: "white" - opacity: 0.8 + color: qgcPal.windowShadeDark - Text { - id: titleBar + Text { + id: titleBar - width: parent.width - height: parent.titleHeight + width: parent.width + height: parent.titleHeight - verticalAlignment: TextEdit.AlignVCenter - horizontalAlignment: TextEdit.AlignHCenter + verticalAlignment: TextEdit.AlignVCenter + horizontalAlignment: TextEdit.AlignHCenter - text: control.text - font.pixelSize: 12 + text: control.text.toUpperCase() + color: qgcPal.buttonText + font.pixelSize: 12 - Rectangle { - id: setupIndicator + Rectangle { + id: setupIndicator - property bool setupComplete: true - readonly property real indicatorRadius: 6 + property bool setupComplete: true + readonly property real indicatorRadius: 6 - x: parent.width - (indicatorRadius * 2) - 5 - y: (parent.height - (indicatorRadius * 2)) / 2 - width: indicatorRadius * 2 - height: indicatorRadius * 2 + x: parent.width - (indicatorRadius * 2) - 5 + y: (parent.height - (indicatorRadius * 2)) / 2 + width: indicatorRadius * 2 + height: indicatorRadius * 2 - radius: indicatorRadius - color: control.setupComplete ? "green" : "red" - } + radius: indicatorRadius + color: control.setupComplete ? "#00d932" : "red" } + } - Rectangle { - width: parent.width - height: parent.height - parent.titleHeight - - y: parent.titleHeight + Rectangle { + width: parent.width + height: parent.height - parent.titleHeight - border.color: "#888" + y: parent.titleHeight - gradient: Gradient { - GradientStop { position: 0; color: "#ffffff" } - GradientStop { position: 1; color: "#000000" } - } + color: qgcPal.windowShade - Loader { - anchors.fill: parent - source: summaryQmlSource - } + Loader { + anchors.fill: parent + source: summaryQmlSource } } - - label: Item {} } + + label: Item {} } } } diff --git a/src/VehicleSetup/VehicleSummaryIcon.png b/src/VehicleSetup/VehicleSummaryIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..6aa8343a341df18048e0c9feeeb9491e2c63aaa8 GIT binary patch literal 502 zcmV4hVSb4Mz~&Q&|7Z z&UwJ@ya9HBqBx1P)|D|~jGYBW85^yg3FfMA>TTaE1&sNT#y*VM?;of8n{sAmb;d5v ze@+Qw)dJLAlrS2yOnPkt6^w0b0LoXJ8)gQo!9o%_VWy?AMG=6O#<5&5Q|*DVRb=cn z7tECMj?WMocgX=`r5xXWWvs-)FsLb8VIDTEUyBx0V_-Us)96-ZnAugOg1M)>6Gv?H z>r=qYDPK9UIKo#Q4Wr>eb%AQ+{%b-|9Wuzjl=m_e8>@;fUxNgc0iXf9?3gmJ1}FkP z{oa{=7H|yJlpT9g9C6;UK%3f;B*8n=0H~ZdoiCme>fy2mfXo|L`!|i0kA&D6$0H?1Qb3707*qoM6N<$f(`)6&Hw-a literal 0 HcmV?d00001 -- 2.22.0