From 4a6492d55be73edd41a2c444f5b1dcf21f58b0c1 Mon Sep 17 00:00:00 2001 From: Yasen Date: Wed, 31 Jul 2019 19:18:07 +0200 Subject: [PATCH] Updated Gimbal Indicator - now reflects custom theme Added gimbal pitch SVGs for indoors and outdoors theme --- custom-example/custom.qrc | 3 ++- custom-example/res/CustomCameraControl.qml | 8 +++++--- custom-example/res/Images/gimbal_pitch_indoors.svg | 11 +++++++++++ custom-example/res/Images/gimbal_pitch_outdoors.svg | 11 +++++++++++ 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 custom-example/res/Images/gimbal_pitch_indoors.svg create mode 100644 custom-example/res/Images/gimbal_pitch_outdoors.svg diff --git a/custom-example/custom.qrc b/custom-example/custom.qrc index a53c4ada3c..08de536f4c 100644 --- a/custom-example/custom.qrc +++ b/custom-example/custom.qrc @@ -25,8 +25,9 @@ res/Images/compass_pointer.svg res/Images/distance.svg res/Images/gimbal_icon.svg - res/Images/gimbal_pitch.svg res/Images/gimbal_position.svg + res/Images/gimbal_pitch_indoors.svg + res/Images/gimbal_pitch_outdoors.svg res/Images/horizontal_speed.svg res/Images/microSD.svg res/Images/odometer.svg diff --git a/custom-example/res/CustomCameraControl.qml b/custom-example/res/CustomCameraControl.qml index 2d2b53886f..530c6dbd15 100644 --- a/custom-example/res/CustomCameraControl.qml +++ b/custom-example/res/CustomCameraControl.qml @@ -409,8 +409,9 @@ Item { id: gimbalCol spacing: ScreenTools.defaultFontPixelHeight * 0.75 anchors.centerIn: parent - Image { + QGCColoredImage { source: "/custom/img/gimbal_icon.svg" + color: qgcPal.text width: ScreenTools.defaultFontPixelWidth * 2 height: width smooth: true @@ -419,11 +420,12 @@ Item { fillMode: Image.PreserveAspectFit sourceSize.width: width anchors.horizontalCenter: parent.horizontalCenter + } Image { id: pitchScale height: cameraRect.height * 0.65 - source: "/custom/img/gimbal_pitch.svg" + source: qgcPal.globalTheme === QGCPalette.Light ? "/custom/img/gimbal_pitch_indoors.svg" : "/custom/img/gimbal_pitch_outdoors.svg" fillMode: Image.PreserveAspectFit sourceSize.height: height smooth: true @@ -451,7 +453,7 @@ Item { QGCLabel { id: gimbalLabel text: _gimbalPitch ? _gimbalPitch.toFixed(0) : 0 - color: "#FFF" + color: qgcPal.text font.pointSize: ScreenTools.smallFontPointSize anchors.horizontalCenter: parent.horizontalCenter } diff --git a/custom-example/res/Images/gimbal_pitch_indoors.svg b/custom-example/res/Images/gimbal_pitch_indoors.svg new file mode 100644 index 0000000000..f153e91bbd --- /dev/null +++ b/custom-example/res/Images/gimbal_pitch_indoors.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/custom-example/res/Images/gimbal_pitch_outdoors.svg b/custom-example/res/Images/gimbal_pitch_outdoors.svg new file mode 100644 index 0000000000..90312c77c8 --- /dev/null +++ b/custom-example/res/Images/gimbal_pitch_outdoors.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + -- GitLab