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 aa035643df..f3ce0e7f4b 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 120304bd10..223765f993 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 98b04484a4..1b52474918 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 zcmeAS@N?(olHy`uVBq!ia0y~yV9;b>U{K*;V_;wq`6sNwz`(#+;1OBOz`!jG!i)^F z=14FwFi4iTMwA5Sr-r~(t&oEyhT_IgCAt6cY{lls3x4QKWkA&FS zJ*a)Z{Eb7(F^N?6r}5UuBFb+}ifmdtGkUjb)7HkfTSO;?w>+7f)VuynwLqk&mEw)( zZ~R}qX%*Zg&$8e9h}-%A=IhHFSrvmdZ%8=i&1Z~^V0jjzU(A-^eCL6h*zw&Q6Z+1C za^48dxc6PU?#x1Y4kn9utvPl~Q=D4(Zp&3O$GCe7ge$&zcGu_A7Y6@RZys(aN__wA z<1w{5rDHL>!*ne=H|~9U;kd~2Igw&2>grCjR^QduO*#C?WU5<$Lgo%hd#P(WQOd5H zC5`#q4fnSa@U2DMOF)XcR&6nr5>xR zUTa-2^XN(@^{n<&zh4|)SAX;Jjl7B5HlOP7y>)3`$CQ|TOI5o%70NUopYT`}#K|ss zd%==l`W@4+9lsWJ>-heh%&q6=TSncgYI=K2>i56!21W+XJoXnCO_%jDFfcH9y85}S Ib4q9e0Hdta`v3p{ literal 0 HcmV?d00001 diff --git a/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml b/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml index 352151fa09..991e60bcf4 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 5252478316..629295295f 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 74c0a37b31..da97c55654 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 zcmeAS@N?(olHy`uVBq!ia0y~yV9;b>U{K&-V_;zD&kwX?U|`@Z@Q5sCVBi)8VMc~o zb0ioT7$i$vBT9nv(@M${i&7aJQ}UBi6+Ckj(^G>|6H_V+Po~;1Ffc}Xx;TbZ+AdTdQ&@I6x+RF1?GTh`yxma7w1e{!?~d6D(>)x!l&m|Q?W0cmZwgpZ zSu3G^s#sY`B3bX7QmswS8sE!nnmEp1zFBbn>SvoHf)+v2iyIf_u5gmeOm?fdQyZy$ zK`>vf-|p~b@q!#nxsDxQr)sr&?a9zIyU%x2iQT!`ts+h7yocb*iT46K#a}ekv9<1q zkrw`78G8U>7Sy^fDe$KBJ57X(( z`S};wp9oDl#v;^OCp&lFTVYPwFIQY-oqmeVYMOWL_YviDf5j6R9E_5WMK&H?!N9=4 N;OXk;vd$@?2>_&>w_X4M literal 0 HcmV?d00001 diff --git a/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml b/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml index ac8ab7ae10..02bf27399c 100644 --- a/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.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: mode; text: "Mode switch:" } - Text { + QGCLabel { id: mode; text: "Mode switch:" } + QGCLabel { horizontalAlignment: Text.AlignRight width: parent.width - mode.contentWidth text: autopilot.parameters["RC_MAP_MODE_SW"].value == 0 ? "Setup required" : autopilot.parameters["RC_MAP_MODE_SW"].value @@ -22,8 +23,8 @@ Column { Row { width: parent.width - Text { id: posctl; text: "Position Ctl switch:" } - Text { + QGCLabel { id: posctl; text: "Position Ctl switch:" } + QGCLabel { horizontalAlignment: Text.AlignRight width: parent.width - posctl.contentWidth text: autopilot.parameters["RC_MAP_POSCTL_SW"].value == 0 ? "Not mapped" : autopilot.parameters["RC_MAP_POSCTL_SW"].value @@ -33,8 +34,8 @@ Column { Row { width: parent.width - Text { id: loiter; text: "Loiter switch:" } - Text { + QGCLabel { id: loiter; text: "Loiter switch:" } + QGCLabel { horizontalAlignment: Text.AlignRight width: parent.width - loiter.contentWidth text: autopilot.parameters["RC_MAP_LOITER_SW"].value == 0 ? "Not mapped" : autopilot.parameters["RC_MAP_LOITER_SW"].value @@ -44,8 +45,8 @@ Column { Row { width: parent.width - Text { id: rtl; text: "Return switch:" } - Text { + QGCLabel { id: rtl; text: "Return switch:" } + QGCLabel { horizontalAlignment: Text.AlignRight width: parent.width - rtl.contentWidth text: autopilot.parameters["RC_MAP_RETURN_SW"].value == 0 ? "Not mapped" : autopilot.parameters["RC_MAP_RETURN_SW"].value diff --git a/src/AutoPilotPlugins/PX4/RadioComponent.cc b/src/AutoPilotPlugins/PX4/RadioComponent.cc index 768dd73dd5..125419de48 100644 --- a/src/AutoPilotPlugins/PX4/RadioComponent.cc +++ b/src/AutoPilotPlugins/PX4/RadioComponent.cc @@ -49,9 +49,9 @@ QString RadioComponent::description(void) const "Prior to flight you must also calibrate the extents for all of your channels."); } -QString RadioComponent::icon(void) const +QString RadioComponent::iconResource(void) const { - return ":/files/images/px4/menu/remote.png"; + return "RadioComponentIcon.png"; } bool RadioComponent::requiresSetup(void) const diff --git a/src/AutoPilotPlugins/PX4/RadioComponent.h b/src/AutoPilotPlugins/PX4/RadioComponent.h index 5f91a27d0a..0d00db3252 100644 --- a/src/AutoPilotPlugins/PX4/RadioComponent.h +++ b/src/AutoPilotPlugins/PX4/RadioComponent.h @@ -44,7 +44,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/RadioComponentIcon.png b/src/AutoPilotPlugins/PX4/RadioComponentIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..2dcea31a605145fa705385a6161970cf29e65490 GIT binary patch literal 728 zcmeAS@N?(olHy`uVBq!ia0y~yU@&E1U{K~@V_;w~$#nY0z`(#+;1OBOz`!jG!i)^F z=14FwFi4iTMwA5Srr1ba4!+xb-IT zV&NeJ9^W1R%%x3y9IPDg@@{gJY!pmja`UieOl7*nImyq#EMrE)Dc3tI6}@y+x3oOI z`|=FyhA$~M>&k5SH(pPC_m$`Nay5Zl$4~5by2DvNzj^A7cLy#RA1QhBSx$$EdqZiP z|LJ}kd$xa#xetHW{hNQY{e#X%0Zu!?L+nZoRzZ>``DVd-EEhZ*`kZQP7WN5T^;z!2 z`bO*ia{>340?mxojrZ;5P00G0+`{NCDpb$ty@}zs%c7OVKLv%%9!Rv`xRUZuD4}!h z!F!D<7fqCcH=M1jIAQQ@fmhmYdAofF((Ipx-`%l};r#Zq({uK*-ZXA9URSX&?Q`kX z8qRfHcbGQ6&Gh>-??Z~~F^QN28*z8OPEMPWv)vvb@>m2&R~mYgj+7jW$W&yUqH@v8)4u zr)NG}GH>C=tUBgxlm1L+oNn=2IeTWld{B_}v&thi%OZ8=@)!RRR99MCajtNQ+L_Pc zlkT=|$(b?nxmjgZ#M;BnA%P~nhjyrjd8RGiRkW4ePUTKXfQgiA;uP)4DZ=-(Y9-!I znx{GEXjg64vJaC>14TLy1U^wnw9r(W+3p!WGi77eWW&B$YkDKzC>)+-$D&)hYl)<* zdTl&o&W7_Ff*6Y(FP(Y E}Mpn11ggx*sQ^UJKu53@BfS@x{`@+n(|Z|{jcDNl}j zpMAAk#4IjbTky>>m1avZcDz(#cUtLt z`IM7e^{1`beR6|D!RfmzQf;dBxidcoSZ`DkPN|SL;yU%O`u#%jt?eIYZfYvl+w3*< zitEEGnfaF#Z1$dxX>X|bwwmEUnEj=j>=Kh&J}Nw$>KJ?|Rlo0e{u`~&%%^_7l4HoQ zP0-Kyd*;o5rlUT78Gl=@#b@w-ow93w;`&Do0mm4U*RgI~zhalf29;%VR_=~@ym=zS zSvQUyo4tArW3K<_p2T3=X6AFfUPj?{_l?~K@8{Jxm}i{rRmf+W@cxWO@x+KPCyvOj zW3s4>lgvJNk6Zci@QSx-{GHjEAl}26V4y`&o@4sHt`|9^cBm@Wr~uv zZx+rzetky9d(rM={q65=UDjA3s35A$9e>kw>(2Cd&x=?tOnNE(EkypnF6FGCC3o+! ze3KSpmwIDjc>T(o4@doHl`hyFesI~$4OyNXcaHZcPy6pEA*Q>$P`@z$Nx^ik!;8{? zDzE*NqUf|R+$(-n#OL#$7v}s(S5eRGVqF_~+-OD4o)wagTGhtak|jlp>#lB|r@j12 j)jI#ji(Y+HKETkFv;F&o7=`}~3=9mOu6{1-oD!M<+WtQl literal 0 HcmV?d00001 diff --git a/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml b/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml index 25f237cbd8..9c8311c998 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 3ae331467a..0cb8364c16 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 85b7e14270..dc22c8ebc2 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 d60b06b0cf..829612ba7d 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 627341bbba..3cdcfccf31 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 ba2f03f1a5..612b8430ec 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 53f150cef3..8545a450da 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 zcmeAS@N?(olHy`uVBq!ia0y~yV9;S;U{K*;V_;zTbp1vS0|NtRfk$L90|U1(2s1Lw znj^u$z#v)T8c`CQpH@0|I)Abo;uljB=K16I~0H34V-K5;rdarg8K z-_{*s_RL;;Ci(8ilVKc%va{2lJ`|CfEc=gP;*sxSYHVoh7`0z-jKspH}V&uT6e$Mjd$87exO3lpS!C-dqa+`zh_e^>U@ zt{zpE+*7$xYb=f3pUqhGbL9e6DY4q@y2fYUCN)0Kc(79EyUD%%OYS6}y>MP_>!tAT zH@nt;-}si{NcJ}NO}cXPg?RRqB)n4XJ9h4=P49B6#_%RF W;NG&RqgD(I3=E#GelF{r5}E)~tELwK literal 0 HcmV?d00001 diff --git a/src/VehicleSetup/SetupView.ui b/src/VehicleSetup/SetupView.ui index ca38a2c364..aef9e3e412 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 f1c4929670..7faaad80cf 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 19fe8a5966..397f3c6c88 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 acc4d5da4f..18a7144866 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 zcmeAS@N?(olHy`uVBq!ia0y~yU{GaXU{K~@V_;wqK7Lq^fq{Xuz$3Dlfq`2Xgc%uT z&5>YWV2~_vjVKAuPb(=;EJ|f?Ovz75Rq)JBOiv9;O-!jQJeg|4z`)q->EaktaqGOg`*W5;&(Ma4u;IV3Lh!QjM`PSb0E5Pj&_$N5yMicY(XX5&zGet32>- z4`W&5B8$!~*QOdK_RM87A?h z<4nHFbR~9*fz&3Ss$6E#p4@DPQ{l6v)7VxWbP}>mT()$ht6;;lV;f@(g5Nf73{81s zDt>0lr@r$7lI15Elb6ceuS;EXFoi>Ps?ctUy1vb z`=C5|zQ_0VQ}l)RKRekQxgyB1@W!9D^BEXc%rT#>>fZaNpiwSa+vfx*+&&t;uc GLK6TE0Lsn) literal 0 HcmV?d00001 -- GitLab